• 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

Doubt on Servlet having database connection?

 
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Objects,

I am having problem in the following case:

I am developing an application using servlet program.
In which, I need to connect with Database (Oracle)

I have tried with JDBC Type1 driver(JDBC-ODBC Bridge driver) to connect my servlet with Database with the help of DSN.

But it throws the following SQL exception at runtime:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)

...

The same DSN is tested with local java program(having main method) whic is working fine.

I would like to know,whether JDBC-ODBC brigde driver is supported with Oracle database through Servlet programming?

If yes the how?

If not,then I think we have to use other types of driver(2,3,4).Right?

Please suggest...


Thank you.

Regards
Baseet Ahmed

"God has made every living thing from water."
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you set up the DSN as a user DSN or as a system DSN?

Generally, the JDBC/ODBC brodge should not be used in multi-threaded environments (like a servlet container) - it is not threadsafe.
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you import classe12.jar file.Its in oracle lib folder
 
Ranch Hand
Posts: 686
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Baseet Ahmed:
Hi Objects,

I am developing an application using servlet program.
In which, I need to connect with Database (Oracle)
[/b]



You don't need jdbc/odbc driver for connecting with Oracle. As mentioned in previous post you need oracle12.jar.
 
Baseet Ahmed
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf/Sruthi/Jignesh
Thank you for reply.

For Ulf:
I had tried with User DSN,will check with system dsn.
Normally we used Oracle's driver(type3 or 4)
This I was doing for checking whether it works or not.

For Sruthi:
I think, in case of bridge driver, this classe12.jar file is not required, as also mentioned by Jignesh.

For Jignesh:
Thank you for the same.

Thank you once again to all.

Regards
Baseet Ahmed

"God has made every living thing from water." --Holy Quran
 
Baseet Ahmed
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf Dittmer,

Thank you very much.
As I am able to run servlets having JDBC Database connection using DSN.
This time,have used the System DSN as mentioned by you.


Can you tell me why is this so that, it was not working with User DSN but works with System DSN.

Anyways,Concern person can close this Post.

Thank you

Regards
Baseet Ahmed

Request to ALL:
"Do worship The Creator,not the creation."
 
Stop it! You're embarassing me! And you are embarrassing this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic