This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC:ODBC Oracle Connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC:ODBC Oracle Connection" Watch "JDBC:ODBC Oracle Connection" New topic
Author

JDBC:ODBC Oracle Connection

Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
Hi,
I've set up my DSN, named foobar, for my Oracle database. In the Server text box I put the ip address of the server. I now want to connect to it using JDBC:ODBC.
I'm using the following code.

Could someone point out how I connect please?
Frank
[ Edited to format code and fix ]
[ January 31, 2002: Message edited by: David O'Meara ]
Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
I should point out the error I got.
It reads [Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified

Frank
Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
Please ignore the previous posts. I've just read that the JDBC-ODBC bridge driver is dangerous.
I'll try and connnect using an Oracle JDBC driver. Any preferences?
Frank
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

Originally posted by Frank Daly:
Please ignore the previous posts. I've just read that the JDBC-ODBC bridge driver is dangerous.
I'll try and connnect using an Oracle JDBC driver. Any preferences?
Frank

I'd use the Oracle Type-4 (thin) driver by preferance.
Dave.
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

Originally posted by Frank Daly:
Please ignore the previous posts. I've just read that the JDBC-ODBC bridge driver is dangerous.
I'll try and connnect using an Oracle JDBC driver. Any preferences?
Frank

That description of the jdbc dbc bridge is a little harsh! Too often people try to get fancy, and expect the driver to be fully jdbc compliant! As long as you keep it simple, you shouldn't have any coding problems. Most of the descrepancies come at the hands of MS Access and the bridge or client configuration problems/overhead.
I would also recommend the thin(classes12.zip) drivers for Oracle.
Jamie
Frank Daly
Ranch Hand

Joined: Mar 31, 2000
Posts: 139
Thanks guys
Frank
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC:ODBC Oracle Connection