【oracle,jdbc】求助~~麻烦大虾们看看~~~~~~~~~~~~~~~~~~~~~~~
具体错误是
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12518, TNS:listener could not hand off client connection
The Connection descriptor used by the client was:
192.168.1.100:1521:bjpowernode.com
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:380)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
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:839)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at test1.conn.main(conn.java:11)
这是我的java代码
public class conn {
public static void main(String []args){
Connection ct=null;
Statement sm=null;
ResultSet rs=null;
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
ct=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.100:1521:bjpowernode.com","system","tclwaasdngpai");
sm=ct.createStatement();
rs=sm.executeQuery("select * from scott.emp");
while(rs.next()){
System.out.println(rs.getString(2));
}
} catch (Exception e) {
e.printStackTrace();
}finally{
try {
if(rs!=null)rs.close();
if(sm!=null)sm.close();
if(ct!=null)ct.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
listener.ora代码
# listener.ora Network Configuration File: G:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = G:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = bjpowernode.com)
(ORACLE_HOME = G:\oracle\product\10.2.0\db_1)
(SID_NAME = bjpowernode.com)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
tnsnames.ora 代码
# tnsnames.ora Network Configuration File: G:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = SD-20110227RTNV)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = bjpowernode.com)
)
)
Net Configuration Assistant 我测试通过了 端口也打开了 服务也开了为啥就连接不上呢
求大虾们看看啊