• Post Reply Bookmark Topic Watch Topic
  • New Topic

Help needed with JDBC ODBC

 
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
<H3>
SQL exception: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
</H3>
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 servlet.. Do I have to put some jar files or some thing in the Tomcat lib folder.
Help appreciated..
Thanks in advance..
Nasser
 
Sreenivasa Majji
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Change your code from
url = "jdbc dbc:EmpDetails";
to
url = "jdbcdbc:EmpDetails";
Hope this helps.
Sreenivasa Kumar Majji
Sun Certified Java Programmer
SCJP Mock Test
[This message has been edited by sreenivasa majji (edited October 28, 2001).]
[This message has been edited by sreenivasa majji (edited October 28, 2001).]
[This message has been edited by sreenivasa majji (edited October 28, 2001).]
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!