• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Connectivity

 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to connect to an Oracle database using the JDBC-ODBC bridge. I've set up the ODBC (using a System DSN) and I know nothing is wrong with the driver itself. I've signed the jar and given permission in my .java.policy file. When I run the Applet, I get the message No Suitable Driver. I added a snippet of code to make sure the driver was loaded, registered, and JDBC compliant.

Everything seems fine to this point. Has anyone else ran into this problem?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just for giggles, could you list the output of that display code?
 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure!
The following drivers have been registered
sun.jdbc.odbc.JdbcOdbcDriver@5f6303 Version 2.1 JDBC Compliant: true
java.sql.SQLException: No suitable driver
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's been a long time since I used the JDBC-ODBC bridge. You really ought to be using the Oracle driver. JDBC-ODBC is primarily a stopgap designed to support databases whose vendors are too mean-spirited to support Java. But most likely you're not coding the URL properly.
You might also want to test things in an Application first - that way the sandbox won't exacerbate your problems.
 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm just starting to learn Java (2 monts into it) and I'm using the bridge because it's just a Proof of Concept. I'll try moving to an Oracle thin driver. However, the bridge works fine with the same code as a desktop app.
 
Chak Terlapu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the database on the same machine as your applet code? If it is on a different machine then you cannot do it because of applet security features. In that case you need your applet to call a servlet program in order to connect to a remote database.
 
Jeremy Hooie
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I have two boxes - a web server housing the Applet and a database. Can you have database connectivity if you set up policy files and sign the jar?
I know Sun's purpose is to encourage ntier architecture, but it's just a for instance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic