资源简介
自己做的课程设计,不是很高级,但也不是那么简单,该有的东西都有,童叟无欺
代码片段和文件信息
package hhit.qql.house.cndb;
import java.sql.*;
public class cnDB {
public static ResultSet rs = null;
public static Connection dbConn=null;
public static Statement stmt = null;
public static Statement connDB()
{
String driverName=“com.microsoft.sqlserver.jdbc.SQLServerDriver“;
String dbURL=“jdbc:sqlserver://localhost:1433;DatabaseName=二手房中介信息管理系统“;
String userName=“sa“;
String userPwd=“123456“;
try
{
Class.forName(driverName);
dbConn=DriverManager.getConnection(dbURLuserNameuserPwd);
stmt = dbConn.createStatement();
System.out.println(“数据库连接成功“);
}
catch(Exception e)
{
e.printStackTrace();
System.out.print(“数据库连接失败“);
}
return stmt;
}
public static Connection recon()
{
return dbConn;
}
public static boolean executeSQL(String sqlString) {
boolean executeFlag;
try {
stmt.execute(sqlString);
executeFlag = true;
} catch (Exception e) {
executeFlag = false;
System.out.println(“sql exception:“ + e.getMessage());
}
return executeFlag;
}
public static boolean query(String sqlString) {
try {
rs = null;
//System.out.println(sqlString);
rs = stmt.executeQuery(sqlString);
} catch (Exception Ex) {
System.out.println(“sql exception:“ + Ex);
return false;
}
return true;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-12-29 15:59 secondHandHouse\
文件 458 2017-12-29 16:33 secondHandHouse\.classpath
文件 597 2017-12-07 08:24 secondHandHouse\.project
目录 0 2017-12-29 15:59 secondHandHouse\.settings\
文件 57 2017-12-07 08:24 secondHandHouse\.settings\org.eclipse.core.resources.prefs
文件 364 2017-12-07 08:24 secondHandHouse\.settings\org.eclipse.jdt.core.prefs
文件 122 2017-12-07 08:24 secondHandHouse\.settings\org.eclipse.wst.common.project.facet.core.xm
目录 0 2017-12-29 15:59 secondHandHouse\bin\
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\house\
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\house\cndb\
文件 2326 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\cndb\cnDB.class
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\house\housemation\
文件 1722 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\housemation\DelhouseMation.class
文件 4260 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\housemation\updatahouseMation.class
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\house\manager\
文件 2527 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\manager\managerfr
文件 5488 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\manager\managerhousefr
文件 12949 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\manager\managerSession.class
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\house\mation\
文件 4863 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\mation\addhouseMation.class
文件 4623 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\mation\addleaserMation.class
文件 1650 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\mation\addrentMation.class
文件 1717 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\mation\DelleaserMation.class
文件 1592 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\mation\delrentMation.class
文件 4177 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\mation\updataleaserMation.class
目录 0 2017-12-29 15:59 secondHandHouse\bin\hhit\qql\house\usermation\
文件 4598 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\usermation\adduserMation.class
文件 1721 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\usermation\DelluserrMation.class
文件 3963 2017-12-07 08:24 secondHandHouse\bin\hhit\qql\house\usermation\updatauserMation.class
............此处省略44个文件信息
评论
共有 条评论