oracle数据库驱动导入到eclipse没用啊
只能有两张图吗?Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connectionct=DriverManager.getC...
只能有两张图吗?Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection ct=DriverManager.getConnection("jdbd:odbc:yang","c##scott","a6683211"); Statement sm=ct.createStatement(); ResultSet rs= sm.executeQuery("select * from emp"); while(rs.next()){ System.out.println(rs.getString(2)); }
展开
1个回答
展开全部
Oracle(thin)数据库连接:
Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:[DataBase Name]","scott","tiger")
你是怎么写的?
追问
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection ct=DriverManager.getConnection("jdbd:odbc:yang","c##scott","a6683211");
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询