开发者

oracle connectivity

开发者 https://www.devze.com 2022-12-30 09:07 出处:网络
String serverName = \"127.0.0.1\"; String portNumber = \"1521\"; String sid = \"database\"; String url开发者_如何学C = \"jdbc:oracle:thin:@\" + serverName + \":\" + portNumber + \":\" + sid;
String serverName = "127.0.0.1";
String portNumber = "1521";
String sid = "database";
String url开发者_如何学C = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
String username = "scott";
String password = "tiger";
connection = DriverManager.getConnection(url, username, password);

Could not connect to the database


The mother of all connection string sites: http://www.connectionstrings.com/oracle


Assuming your question is "what's wrong with this picture", perhaps you overlooked including the JDBC JAR Driver in the classpath?

0

精彩评论

暂无评论...
验证码 换一张
取 消