• 大小: 1.8MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-07
  • 语言: Java
  • 标签: Javaweb  

资源简介

简单利于xml文件做数据库,请根据代码将users.xml放到指定目录下,或自行修改,仅供初学者参考学习

资源截图

代码片段和文件信息

package cn.xxx.test.user;

import java.sql.Connection;
import java.sql.SQLException;

import org.junit.Test;

import cn.xxx.user.dao.DaoFactory;
import cn.xxx.user.dao.JdbcUtils;
import cn.xxx.user.dao.UserDao;
import cn.xxx.user.domain.User;

/*
 * UserDao的测试
 */
public class UserDaoTest {
@Test
public void testFindByUsername(){
UserDao userDao = DaoFactory.getUserDao();
User user = userDao.findByUsername(“zhaoliu“);
System.out.println(user);
}
@Test
public void testAdd(){
UserDao userDao = DaoFactory.getUserDao();

User user = new User();
user.setUsername(“李四2“);
user.setPassword(“lisi“);
userDao.add(user);
}
@Test
public void fun3() throws SQLException{
Connection con = JdbcUtils.getConnection();
System.out.println(con);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1172  2017-05-09 17:14  FirstWebProject\.classpath

     文件        915  2017-05-08 21:11  FirstWebProject\.project

     文件        567  2017-05-08 21:11  FirstWebProject\.settings\.jsdtscope

     文件        364  2017-05-08 21:11  FirstWebProject\.settings\org.eclipse.jdt.core.prefs

     文件        497  2017-05-08 21:11  FirstWebProject\.settings\org.eclipse.wst.common.component

     文件        345  2017-05-08 21:11  FirstWebProject\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2017-05-08 21:11  FirstWebProject\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2017-05-08 21:11  FirstWebProject\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       1517  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\test\user\UserDaoTest.class

     文件       3775  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\test\user\VerifyCode.class

     文件       1467  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\dao\DaoFactory.class

     文件       2957  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\dao\JdbcUserDaoImpl.class

     文件       1567  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\dao\JdbcUtils.class

     文件        229  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\dao\UserDao.class

     文件       2890  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\dao\UserDaoImpl.class

     文件       1611  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\domain\User.class

     文件        735  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\service\UserException.class

     文件       1538  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\service\UserService.class

     文件       2513  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\web\servlet\LoginServlet.class

     文件       3831  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\web\servlet\RegistServlet.class

     文件       1524  2018-02-07 20:54  FirstWebProject\build\classes\cn\xxx\user\web\servlet\VerifyCodeServlet.class

     文件         55  2017-05-14 15:54  FirstWebProject\build\classes\dao.properties

     文件        118  2017-05-14 15:08  FirstWebProject\build\classes\jdbc.properties

     文件        888  2017-05-14 16:02  FirstWebProject\src\cn\xxx\test\user\UserDaoTest.java

     文件       3055  2017-05-09 17:35  FirstWebProject\src\cn\xxx\test\user\VerifyCode.java

     文件       1044  2017-05-14 14:53  FirstWebProject\src\cn\xxx\user\dao\DaoFactory.java

     文件       2150  2017-05-14 16:29  FirstWebProject\src\cn\xxx\user\dao\JdbcUserDaoImpl.java

     文件       1187  2017-05-14 16:14  FirstWebProject\src\cn\xxx\user\dao\JdbcUtils.java

     文件        171  2017-05-14 13:58  FirstWebProject\src\cn\xxx\user\dao\UserDao.java

     文件       2649  2017-05-14 13:56  FirstWebProject\src\cn\xxx\user\dao\UserDaoImpl.java

............此处省略54个文件信息

评论

共有 条评论