-
大小: 4.62MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-09-21
- 語言: Java
- 標(biāo)簽:
資源簡介
這是基于java做的銀行管理系統(tǒng),附帶mysql數(shù)據(jù)庫,里面還有詳細(xì)操作方式,喜歡的朋友可以來下載

代碼片段和文件信息
package?com.connection;
import?java.sql.Connection;
import?java.sql.DriverManager;
import?java.sql.PreparedStatement;
import?java.sql.ResultSet;
import?java.sql.SQLException;
/**
?*?定義一個數(shù)據(jù)庫的連接及關(guān)閉資源的類
?*?@author?Administrator
?*
?*/
public?class?DBConnection?{
/**
?*?創(chuàng)建數(shù)據(jù)庫的鏈接
?*?@return??返回一個數(shù)據(jù)庫的鏈接
?*/
public?static?Connection?getConnection(){
Connection?conn?=?null;
try?{
Class.forName(“com.microsoft.jdbc.sqlserver.SQLServerDriver“);??//加載數(shù)據(jù)庫驅(qū)動
String?url?=?“jdbc:microsoft:sqlserver://localhost:1433;databaseName=account“;?
String?username?=?“sa“;????//數(shù)據(jù)庫用戶名
String?password?=?“1126“;????//數(shù)據(jù)庫密碼
conn?=?DriverManager.getConnection(urlusernamepassword);???//獲得數(shù)據(jù)庫的鏈接
????????????
}?catch?(ClassNotFoundException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}??catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
return?conn;
}
/**
?*?關(guān)閉數(shù)據(jù)庫資源
?*?@param?obj??數(shù)據(jù)庫打開的資源對象(在此處用object,因為鏈接數(shù)據(jù)庫是會打開多個資源)
?*/
public?static?void?closeobject(object?obj){
if(obj?!=?null){
if(obj?instanceof?ResultSet){
try?{
((ResultSet)?obj).close();
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
}
if(obj?instanceof?PreparedStatement){
try?{
((PreparedStatement)?obj).close();
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
}
if(obj?instanceof?Connection){
try?{
((Connection)?obj).close();
}?catch?(SQLException?e)?{
//?TODO?Auto-generated?catch?block
e.printStackTrace();
}
}
}
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????67584??2013-06-14?08:24??114105153\文檔模板.doc
?????文件???????5782??2011-12-30?10:12??114105153\銀行賬戶管理\account.sql
?????文件?????422912??2012-01-02?23:20??114105153\銀行賬戶管理\使用說明.doc
?????文件????1672192??2012-01-03?10:37??114105153\銀行賬戶管理\實驗報告-打印版.doc
?????文件????2063360??2012-01-03?10:39??114105153\銀行賬戶管理\實驗報告-電子版.doc
?????文件????????598??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\.classpath
?????文件????????400??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\.project
?????文件?????286707??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\msba
?????文件??????67024??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\mssqlserver.jar
?????文件??????58903??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\msutil.jar
?????文件?????448038??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\sqljdbc.jar
?????文件?????466359??2012-01-02?21:52??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\sqljdbc4.jar
?????文件????????416??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\main\Begin.class
?????文件???????3170??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3831??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????4205??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????2457??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3355??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3216??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????4663??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3343??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3898??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????1189??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????2451??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????2330??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3332??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3242??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????3939??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????2710??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
?????文件???????2536??2013-06-18?09:50??114105153\銀行賬戶管理\銀行賬戶管理系統(tǒng)\bin\com\fr
............此處省略83個文件信息
評論
共有 條評論