文件名称:MyEclipse+WebLogic+MySQL数据源
文件大小:1.3MB
文件格式:RAR
更新时间:2015-01-11 10:31:27
MyEclipse+WebLogic+MySQL数据源
package com.pool.org.dao.impl; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.util.ArrayList; import java.util.List; import com.pool.org.dao.UserDao; import com.pool.org.entity.Users; import com.pool.org.util.DataSourceUtil; /*** *作 者:龙叔 *创建时间:2011-12-8 *Project:weblogic_pool *类 名:UserDao.java */ public class UserDaoImpl implements UserDao { Connection conn=null; public List getUserList() throws Exception { conn = DataSourceUtil.getConnection(); String sql = "select * from user"; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql); List list = new ArrayList(); while (rs.next()) { Users user = new Users(); user.setId(rs.getInt("id")); user.setPassword(rs.getString("password")); user.setUsername(rs.getString("username")); list.add(user); } return list; } }
【文件预览】:
weblogic_pool
----src()
--------com()
----.classpath(433B)
----.mymetadata(312B)
----.settings()
--------org.eclipse.wst.jsdt.ui.superType.container(49B)
--------org.eclipse.wst.jsdt.ui.superType.name(6B)
--------.jsdtscope(500B)
--------org.eclipse.jdt.core.prefs(332B)
----.project(1KB)
----weblogic_pool.war(668KB)
----WebRoot()
--------META-INF()
--------index.jsp(856B)
--------userlist.jsp(1KB)
--------user.sql(727B)
--------WEB-INF()