?? dblink.java~3~
字號:
package com.hugj.sunqi.mybank.model;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class DBLink { private java.sql.Connection conn; private java.sql.Statement stmt; private java.sql.ResultSet rs; private String classForName="com.microsoft.jdbc.sqlserver.SQLServerDriver"; private String url="jdbc:microsoft:sqlserver://localhost:1433;DataBaseName=HUGJ"; public DBLink() { } //數據庫連接 public java.sql.Statement conn(){ try{ Class.forName(classForName); conn = java.sql.DriverManager.getConnection(url,"sa","qaz123"); stmt = conn.createStatement(); return stmt; }catch(Exception e){ System.out.println(e.getMessage()); return null; } }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -