资源简介

完整的java版基金管理系统,可用作java,数据库相关课程设计、毕业设计代码参考学习

资源截图

代码片段和文件信息

package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

import entity.Client;

public class ClientDao {
private ClientDao() {

}

private static ClientDao cd;

public static ClientDao getClientDao() {
if (cd == null) {
cd = new ClientDao();
}
return cd;
}

public void insertClient(Connection con Client client) throws Exception {
String sql = “insert into client(clientNameIDCardNOsexphoneaddressemailhobby) values(???????)“;
PreparedStatement ps = con.prepareStatement(sql);
ps.setString(1 client.getClientName());
ps.setString(2 client.getIDCardNo());
ps.setString(3 client.getSex());
ps.setString(4 client.getPhone());
ps.setString(5 client.getAddress());
ps.setString(6 client.getEmail());
ps.setString(7 client.getHobby());
ps.executeUpdate();
}

public Client select(Connection con Client client) throws Exception {
String sql = “select * from client where clientNO=? and IDCardNO=?“;
PreparedStatement ps = con.prepareStatement(sql);
ps.setInt(1 client.getClientNo());
ps.setString(2 client.getIDCardNo());
ResultSet rs = ps.executeQuery();
if (rs.next()) {
client.setClientNo(rs.getInt(1));
client.setClientName(rs.getString(2));
client.setSex(rs.getString(4));
client.setIDCardNo(rs.getString(3));
client.setPhone(rs.getString(5));
client.setAddress(rs.getString(6));
client.setEmail(rs.getString(7));
client.setHobby(rs.getString(8));
return client;
}
throw new Exception(“无法查询到该客户!“);
}

public void update(Connection con Client client) throws SQLException {
String sql = “update client set clientName=?IDCardNO=?sex=?phone=?address=?email=?hobby=? where clientNo=?“;
PreparedStatement ps = con.prepareStatement(sql);
ps.setString(1 client.getClientName());
ps.setString(2 client.getIDCardNo());
ps.setString(3 client.getSex());
ps.setString(4 client.getPhone());
ps.setString(5 client.getAddress());
ps.setString(6 client.getEmail());
ps.setString(7 client.getHobby());
ps.setInt(8 client.getClientNo());
ps.executeUpdate();
}

public Vector setect(Connection con int clientno) throws Exception {

String sql = “select fund.fundNamefund.price price1fund.statusfund_account.fund_acc_nofund_account.quantityfund_account.price price2 from fundfinancial_accountfund_account where fund.fundNo=fund_account.fundNo and fund_account.accountNo=financial_account.accountNo and financial_account.clientNo=?“;
PreparedStatement ps = con.prepareStatement(sql);
ps.setInt(1 clientno);
ResultSet rs = ps.executeQuery();
Vector vec = new Vector();
while (rs.next()) {
Vector fund = new Vector();
fund.add(String.valueOf(rs.getInt(“fund_acc_no“)));
fund.add(rs.getString(“fundName“));
fund.add(String.valueOf(rs.getInt(“quantity“)));
fun

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

     文件        433  2011-02-27 16:19  fund\.classpath

     文件        285  2011-07-24 15:25  fund\.mymetadata

     文件       1006  2011-02-27 16:15  fund\.project

     文件       3273  2011-05-09 22:16  fund\src\dao\ClientDao.java

     文件       2569  2011-02-27 16:15  fund\src\dao\Financial_accountDao.java

     文件       2617  2011-05-09 22:19  fund\src\dao\FundDao.java

     文件       4691  2011-05-09 22:18  fund\src\dao\Fund_accountDao.java

     文件       1613  2011-05-09 22:19  fund\src\dao\SalesDao.java

     文件       2246  2011-02-27 16:15  fund\src\entity\Client.java

     文件       1128  2011-02-27 16:15  fund\src\entity\Financial_Account.java

     文件       1377  2011-05-09 22:16  fund\src\entity\Fund.java

     文件       1020  2011-02-27 16:15  fund\src\entity\Fund_Account.java

     文件       1194  2011-05-09 22:16  fund\src\entity\Sales.java

     文件       3547  2011-02-27 16:15  fund\src\ui\Client_add.java

     文件       2670  2011-02-27 16:15  fund\src\ui\Client_find.java

     文件       6967  2011-05-09 22:31  fund\src\ui\Client_info.java

     文件       3994  2011-02-27 16:15  fund\src\ui\Client_update.java

     文件       3283  2011-05-09 22:24  fund\src\ui\Financial_add.java

     文件       2529  2011-05-09 22:25  fund\src\ui\Financial_amount_add.java

     文件       2745  2011-02-27 16:15  fund\src\ui\Financial_amount_delete.java

     文件       1934  2011-02-27 16:15  fund\src\ui\Financial_find.java

     文件       3654  2011-02-27 16:15  fund\src\ui\Financial_update.java

     文件       5121  2011-02-27 16:15  fund\src\ui\Fund_account_add.java

     文件       2554  2011-02-27 16:15  fund\src\ui\Fund_account_delete.java

     文件       2256  2011-02-27 16:15  fund\src\ui\Fund_account_display.java

     文件       1914  2011-02-27 16:15  fund\src\ui\Fund_account_find.java

     文件       2510  2011-02-27 16:15  fund\src\ui\Fund_add.java

     文件       2213  2011-02-27 16:15  fund\src\ui\Fund_find.java

     文件       3172  2011-02-27 16:15  fund\src\ui\Fund_update.java

     文件       3053  2011-02-27 16:15  fund\src\ui\LeftMenu.java

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

评论

共有 条评论