• 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

Servlet and JDBC driver...need help

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,
I have created a servlet which connect with Access db and get data. When I run my servlet it throws me an error which says
SQL exception: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
My code is...
url = "jdbc dbc:EmpDetails";
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
conn = DriverManager.getConnection(url);
stmt = conn.createStatement();

rs = stmt.executeQuery("SELECT * FROM ClientInfo");
my DSN name is "EmpDetails"
my Table name is "ClientInfo"
can some one tell me why is it giving me error?.
I have tried another class file to connect to db and it worked fine. But that was class file and called directly (I mean without a call from Tomcat). This is a servlet and called from a server.. Do I have to put some jar files or some thing in the Tomcat lib folder.
Help appreciated..
Thanks in advance..
Nasser

[This message has been edited by Nasser Aboobaker (edited October 27, 2001).]
 
Saloon Keeper
Posts: 27752
196
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
The message is coming from the Microsoft ODBC driver. It says that you didn't supply a DSN or default ODBC driver and it can't figure out what to do.
Your bigger problem is going to be trying to do real-world work, since although you can fix your DSN problem, the jdbc-odbc bridge (and in particulate to Access and FoxPro) isn't threadsafe, so data corruption can occur unpredictably.
 
Nasser Aboobaker
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I correct this problem..
any link or suggestion..
Thanks
Nasser
 
Nasser Aboobaker
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
mmmmmmmmmmmmmmm well got it running....
Thanks
Nasser
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic