Greetings,
I wrote a small Java program to connect to an existing datasource using the jdbc-odbc bridge. The compile is successful. However, when launching the class file, I get the following error message:
ORA-12154:TNS:could not resolve service name
Here's a snippet of my code describing the proposed connection:
try
{
//Load Sun's jdbc-odbc driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"
;
}
catch(ClassNotFoundException cnfe) // Driver not found
{
System.err.println("Unable to load Database Driver."
;
System.err.println("Details: "+cnfe);
System.exit(0);
}
//Create the database connection
Connection db_connection = DriverManager.getConnection("jdbc
dbc:datasourcename","userid","password"
;
If I manually log on to SQLPlus, I have no problem connecting to my data source.
Thanks for your help.
JDOne
I wrote a small Java program to connect to an existing datasource using the jdbc-odbc bridge. The compile is successful. However, when launching the class file, I get the following error message:
ORA-12154:TNS:could not resolve service name
Here's a snippet of my code describing the proposed connection:
try
{
//Load Sun's jdbc-odbc driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"
}
catch(ClassNotFoundException cnfe) // Driver not found
{
System.err.println("Unable to load Database Driver."
System.err.println("Details: "+cnfe);
System.exit(0);
}
//Create the database connection
Connection db_connection = DriverManager.getConnection("jdbc
If I manually log on to SQLPlus, I have no problem connecting to my data source.
Thanks for your help.
JDOne