相关代码 |
|
/* *DbConn.java:建立数据库的连接。 */ import java.sql.*; import java.math.*; public class DbConn { private Connection conn; public DbConn() { try { conn = DriverManager.getConnection("jdbc:odbc:Database","samples","samples"); } catch (java.sql.SQLException s) { System.out.println("exception: " + s.getMessage()); } } public Connection getConnection() { return conn; } }
相关资源 |
|