有人可以帮我解释为什么我在尝试从
java连接到Oracle数据库时收到以下错误….
连接呼叫是:
Connection con = DriverManager.getConnection( "jdbc:oracle:thin:@winson.net:1522/hcrod","manager","passing");
我收到以下错误:
java.sql.sqlException: Listener refused the connection with the following error: ORA-12514,TNS:listener does not currently know of service requested in connect descriptor at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:113) at oracle.jdbc.driver.DatabaseError.throwsqlException(DatabaseError.java:263) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:389) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:454) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:802) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at test_sample.main(test_sample.java:15)
解决方法
在类似的情况下,我工作了一个稍微的其他连接字符串:
JDBC:神谕:薄:@ winson.net:1522:hcrod
JDBC:神谕:薄:@ winson.net:1522:hcrod
真的没有//和with:而不是/