我用自己创建的test账户,已经给予了dba权限,在plsql下用test账户登录则可以查询到该表,确信该表存在。
还有如果在JDBC用sys账户则无法建立连接,确信账号密码没错
Connection con = null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@192.168.56.128:1521:orcl";
String user = "test";
String password = "test";
con = DriverManager.getConnection(url, user, password);
System.out.println("connect completed!");
return con;
} catch (Exception e) {
e.printStackTrace();
} finally {
// con.close();
}
Exception in thread "main" java.sql.SQLException: ORA-00942: 表或视图不存在