oracle connectivity
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?
精彩评论