• 大小: 1.53MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-05
  • 语言: Java
  • 标签: java  

资源简介

java dvd影碟管理系统 swing界面

资源截图

代码片段和文件信息

	package dvd.db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class DbUtil {
Connection conn;
Statement stmt;
ResultSet rs;
String url=“jdbc:mysql://localhost:3306/dvd?user=root&password=912286&charactorEncoding=gbk“;
public DbUtil(){
try {
Class.forName(“com.mysql.jdbc.Driver“);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void getConn(){

try {if(this.conn==null)
this.conn=DriverManager.getConnection(url);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//return this.conn;

}

/*public Statement getStmt(Connection conn){
try {
this.stmt=conn.createStatement();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//return this.stmt;

}*/
public ResultSet query(String sql){
try {
this.getConn();
stmt=conn.createStatement();
    rs=stmt.executeQuery(sql);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return rs;
}

public int update(String sql){
int flag= 0;
this.getConn();
//conn.setAutoCommit(false);
try {
stmt = conn.createStatement();
flag = stmt.executeUpdate(sql);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return flag;
}

/*public void openTransaction() throws SQLException{
conn.setAutoCommit(false);
}

public void commit() throws SQLException{
conn.commit();
}
public void rollBack() throws SQLException{
conn.rollback();
}*/


public void closeAll(){
try {
if(rs!=null||stmt!=null||conn!=null){
rs.close();
stmt.close();
    conn.close();
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}


}

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

     文件        390  2012-06-01 14:52  dvdproject\dvdproject\.classpath

     文件        386  2012-05-31 15:03  dvdproject\dvdproject\.project

     文件        598  2012-06-01 09:10  dvdproject\dvdproject\.settings\org.eclipse.jdt.core.prefs

     文件       2002  2012-06-15 09:09  dvdproject\dvdproject\bin\dvd\db\DbUtil.class

     文件      10445  2012-06-16 18:12  dvdproject\dvdproject\bin\dvd\db\FilmDao.class

     文件       3261  2012-06-17 11:33  dvdproject\dvdproject\bin\dvd\db\ManagerDao.class

     文件       4897  2012-06-16 16:34  dvdproject\dvdproject\bin\dvd\db\UserDao.class

     文件       2134  2012-06-14 17:26  dvdproject\dvdproject\bin\dvd\entity\Film.class

     文件       2087  2012-06-16 14:31  dvdproject\dvdproject\bin\dvd\entity\HireRecord.class

     文件       1338  2012-06-16 10:09  dvdproject\dvdproject\bin\dvd\entity\Manager.class

     文件       1713  2012-06-15 09:03  dvdproject\dvdproject\bin\dvd\entity\User.class

     文件      90545  2012-06-18 12:06  dvdproject\dvdproject\bin\dvd\image\%5Bwallcoo_com%5D_LOMO_lomography_Mullaghmore%20Grass.jpg

     文件      25238  2012-06-18 11:44  dvdproject\dvdproject\bin\dvd\image\215-121.jpg

     文件     260254  2012-06-18 11:58  dvdproject\dvdproject\bin\dvd\image\3488035_104057013097_2_副本.jpg

     文件       3263  2012-06-16 18:09  dvdproject\dvdproject\bin\dvd\model\FilmService.class

     文件       1119  2012-06-17 11:16  dvdproject\dvdproject\bin\dvd\model\ManagerService.class

     文件       1664  2012-06-16 09:48  dvdproject\dvdproject\bin\dvd\model\UserService.class

     文件        329  2012-06-17 10:45  dvdproject\dvdproject\bin\dvd\util\GlobalManager.class

     文件        716  2012-06-18 11:46  dvdproject\dvdproject\bin\dvd\window\About$1.class

     文件        715  2012-06-18 11:46  dvdproject\dvdproject\bin\dvd\window\About$2.class

     文件       2369  2012-06-18 11:46  dvdproject\dvdproject\bin\dvd\window\About.class

     文件        726  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmAdd$1.class

     文件       1988  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmAdd$2.class

     文件        727  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmAdd$3.class

     文件       3924  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmAdd.class

     文件        761  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmByDirector$1.class

     文件       2310  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmByDirector$2.class

     文件        869  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmByDirector$3.class

     文件       3163  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmByDirector.class

     文件        741  2012-06-17 21:29  dvdproject\dvdproject\bin\dvd\window\FilmByLead$1.class

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

评论

共有 条评论