eclipse中用java 连接oracle
eclipse中用java 连接oracle 是怎么连接的?
是下面那样?
oracle.jdbc.driver.OracleDriver 需要导入什么包吗?具体文件名知道吗?
下面语句中的 SERVER是什么?IP? sdcdb是数据库名字?
String url="jdbc:oracle:thin:@Server:1521:SDCDB";
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(
java.lang.ClassNotFoundException e)
{
System.err.print(e.getMessage());
}
String url="jdbc:oracle:thin:@Server:1521:SDCDB";
Connection conn=DriverManager.getConnection(url,"test","test");
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select score from MY");
while(rs.next())
------解决方案--------------------要连oralce当然要导classes12.jar包,
去下包吧:http://download.csdn.net/down/325587/Actionmr.~~
------解决方案--------------------Server 写ip地址