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:
