This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic