freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java課程設(shè)計學(xué)生成績管理系統(tǒng)說明書-資料下載頁

2025-08-07 11:38本頁面
  

【正文】 [11] 核心研究室 ,雷穎杰 ,陳錦輝. 精通 Delphi6 數(shù)據(jù)庫程序設(shè)計[M]. 北京:中國鐵道出版社,2022 年 7 ~110[12] 啟明工作室. Delphi+ SQL Server 數(shù)據(jù)庫應(yīng)用系統(tǒng)開發(fā)與實(shí)例[M]. 北京:人民郵電出版社,2022 年 4 ~125附錄(1) 窗體居中代碼LoginFrame loginFrame=new LoginFrame()。 //()。 // Center the window Dimension screenSize = ().getScreenSize()。 Dimension frameSize = ()。 if ( ) { = 。 } if ( ) { = 。 } (( ) / 2, ( ) / 2)。 (true)。(2) 連接數(shù)據(jù)庫代碼public LoginAction() { try{ (正在加載驅(qū)動程序......)。 ()。 (加載驅(qū)動程序成功)。 }catch(ClassNotFoundException e){ (加載驅(qū)動程序失敗)。 }//end trycatch }//end 構(gòu)造函數(shù) // 和數(shù)據(jù)庫建立連接 public Connection getConnection(){ Connection con=null。 String url=jdbc:g=GBK。 String user=root。 String password=。 try{ (正在和數(shù)據(jù)庫建立連接......)。 //con = (jdbc:rueamp。characterEncoding=GBK,)。//String url=jdbc:K。 con=(url, user, password)。 (數(shù)據(jù)庫連接成功)。 }catch(SQLException e){ (無法和數(shù)據(jù)庫建立連接)。 }//end trycatch return con。 } //在數(shù)據(jù)庫中驗證用戶合法性 public UserInfoBean verifyteacher(UserInfoBean user){ PreparedStatement ps=null。 ResultSet rs=null。 if(con==null){ con=()。 } UserInfoBean newUser=null。 String sqlstr=select * from teacher where userid=? and userpwd=?。 try{ ps=(sqlstr)。 (1, ())。 //設(shè)置參數(shù)1:用戶賬號id(2, ())。 //設(shè)置參數(shù)2:用戶密碼// (3, ())。 //設(shè)置參數(shù)3:角色id rs=()。 if(()){ //如果用戶提供的賬號、密碼和角色正確 (有這個用戶)。 newUser=user。 ((1))。 //((4))。 } }catch (SQLException e) { (驗證用戶合法性時出錯+())。 }finally{ //關(guān)閉數(shù)據(jù)庫連接對象 try{ if(rs!=null) ()。 if(ps!=null) ()。 if(con!=null) ()。 }catch(SQLException ex){ //do nothing } } return newUser。 }(3) 查詢數(shù)據(jù)庫中信息代碼public managerstudentframe(){setSize(700,500)。//setDefaultCloseOperation()。JPanel contentPane。contentPane=(JPanel) ()。(tablepanel,)。//在panel1中顯示數(shù)據(jù)庫中manager表的內(nèi)容try{()。String use=root。 String password=。String url=jdbc:oding=GBK。Connection con =con=(url,use, password)。Statement state = (, )。 // 執(zhí)行SQL語句 String sql = select * from student。 ResultSet rs = (sql)。 displayResultSet(rs)。 ()。 ()。 ()。} catch(Exception e){(連接manager數(shù)據(jù)庫失敗+())。}}public void displayResultSet(ResultSet rs) throws Exception { boolean moreRecords = ()。 // 定位到達(dá)第一條記錄 if (!moreRecords) { (null, 結(jié)果集中無記錄, 無記錄, )。 return。 } Vector rows = new Vector()。 Vector columnHeads = new Vector()。 try { rsmd = ()。 // 獲得rs結(jié)果集中列屬性信息 for (int i = 1。 i = ()。 ++i) ((i))。 // 獲得列名(將列名存放至向量columnHeads) do { (getNextRow(rs, rsmd))。 } while (())。 // 利用循環(huán)獲得所有記錄 JTable jTable = new JTable(rows, columnHeads)。 // 將獲得的行列數(shù)據(jù)信息作為參數(shù)重新構(gòu)造表格視圖 (new Dimension(700,500))。 JScrollPane scroller = new JScrollPane(jTable)。// 創(chuàng)建帶有滾動條的面板,并將表格視圖加入 //add(scroller,)。 // 獲取溶器 // (2)。 // // 從溶器中移除指定控件(本窗體中有二級面板有兩個,第一個存放文本域及按鈕,第二個存放表格視圖,故移除1)(scroller, )。 // 將面板重新加入溶器中 validate()。 // 驗證此容器及其所有子組件 } catch (Exception e) { ()。 } } public Vector getNextRow(ResultSet rs, rsmd)throws Exception {Vector currentRow = new Vector()。 // 定義一個向量,用于存放記錄 for (int i = 1。 i = ()。 ++i) ((i))。 // 獲取記錄 return currentRow。 // 返回記錄 }(4) 向數(shù)據(jù)庫中添加信息代碼public int adduser(managerBean user){String sqlstr=insert into teacher (userno,userid,userpwd) values(?,?,?)。int result=0。PreparedStatement ps=null。Connection con=null。LoginAction m=new LoginAction()。 if(con==null){ con=()。 } (數(shù)據(jù)庫已經(jīng)連接上)。 (正在插入數(shù)據(jù)……)。 try{ ps=(sqlstr)。 (1,())。 (2,())。 (3,())。 int rs=()。 (插入數(shù)據(jù)成功!)。 //return rs。 //if(rs!=null) ()。 // if(ps!=null) ()。 //if(con!=null) ()。 }catch(Exception z){ (())。 }
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1