Home > database >  Java to connect the oracle database error ntly know of the service requested in the connect descript
Java to connect the oracle database error ntly know of the service requested in the connect descript

Time:12-17

Protected the static String dbClassName="... The oracle JDBC driver OracleDriver ";
The static
{
Try
{
Class.forname (dbClassName). NewInstance ();//load database driven class
The Connection conn=DriverManager. GetConnection (" JDBC: oracle: thin: @ 10.225.1.149:1521/CBHB ", "gthdep",
"Gthdep");
System. The out. Println (" connection success ");
Conn. Close ();

}
The catch (Exception ee)
{
Ee. PrintStackTrace ();
}
}


This is my code, is a remote database connection. Use PLSQL is able to connect. Use the JDBC how to quote this kind of mistake?
My little novice a master need your counsel.

CodePudding user response:

I find the question, is @ 10.225.1.149:1521/CBHB accustomed to the direct connection of PLSQL, there should be a @ 10.225.1.149:1521: CBHB, and CBHB should be middle the SERVICE_NAME (database).

CodePudding user response:

CodePudding user response:

CodePudding user response:

  • Related