eclipe连接oracle获取Connection
时间:2021-07-01 10:21:17
帮助过:2人阅读
java.sql.Connection;
import java.sql.DriverManager;
import pers.xkk.telbook.util.Constant;
public class DBHelper {
private Connection conn =
null;
public DBHelper() {
try {
Class.forName(Constant.JDBC_NAME);// 指定连接类型
this.conn =
DriverManager.getConnection(Constant.JDBC_URL,
Constant.UESR_NAME, Constant.PASSWORD);// 获取连接
}
catch (Exception e) {
e.printStackTrace();
}
}
public void setConn(Connection conn) {
this.conn =
conn;
}
public Connection getConn() {
return this.conn;
}
}
eclipe连接oracle获取Connection
标签: