您在下面的代码中引用Oracle JDBC6连接。
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
System.out.println("Where is your Oracle JDBC Driver?");
e.printStackTrace();
return;
}
Connection connection = null;
try {
connection = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:xe","system","password");
} catch (SQLException e) {
e.printStackTrace();
return;
}
if (connection != null) {
System.out.println("You made it, take control your database now!");
} else {
System.out.println("Failed to make connection!");
}
参考以下链接:http://www.codejava.net/java-se/jdbc/connect-to-oracle-database-via-jdbc
能否请注明您的pom.xml的相关部分? –