ODBC connection works but not JDBC [message #360131] |
Wed, 19 November 2008 13:05 |
VanJay011379
Messages: 3 Registered: October 2008 Location: Pittsburgh, PA
|
Junior Member |
|
|
Hello,
I am trying to use the thin client connection of the JDBC connection to connect to an Oracle 8i database on another server.
I can connect via ODBC with the following code in VBA just fine.
Dim cn As ADODB.Connection 'as you are typing adodb vb will automatically autohelp - if not then you don't have a reference to ado
Dim rs As ADODB.RecordSet
Set cn = New ADODB.Connection
cn.Open "Promise", "name", "password"
Set rs = New ADODB.RecordSet
Set rs = New ADODB.RecordSet
rs.Open "select * from v$version;", cn
MsgBox (rs.Fields(0))
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
However, the following code does not work in JDBC.
<%
DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@xxx.xxx.xxx.xxx:yyyyy:zzzzz", "name", "password");
%>
I blanked out the login names, IP, port and SIDs for security reasons obviously.
In my JDBC attempt, I get the following message.
ORA-01017: invalid username/password; logon denied
I am using the same login name and password for the ODBC connection in VBA and the JDBC connection in Java.
Interestingly enough, when I change the password in my ODBC VBA attempt to a wrong entry, I get the same error.
Why won't this connection in JDBC work?
I know the SID, port and IP are correct as I copied them strait from the tnsnames.ora file.
Any suggestions? Thanks in advance.
|
|
|