• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet and JDBC driver...need help  RSS feed

 
Nasser Aboobaker
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • 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).]
 
Tim Holloway
Bartender
Posts: 18781
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
mmmmmmmmmmmmmmm well got it running....
Thanks
Nasser
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!