• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database Connectivity

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Saloon Keeper
Posts: 27886
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 27886
198
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic