Click to See Complete Forum and Search --> : JDBC connection through SERVLET???


January 31st, 2000, 04:00 AM
am trying to connect to database using JdbcOdbc driver in the init mathod of a Servlet. I have tested the connection writting a test
java code. Connection is ok. But while executing Servlet it gives error:

SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
===================================
class.forName(sun.jdbc.odbc.JdbcOdbcDriver);
con = DriverManager.getConnection("jdbc:odbc:testmdb","bsw", "bsw");

sami_ulla@yahoo.com

January 31st, 2000, 10:30 AM
Just a small point but you should put quotes in class.forName
class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
in the code below.
You also need to create a ODBC profile too,for "testmdb", on the server where your servlet is in case you have not done that

xjali
February 7th, 2000, 09:19 AM
hai friend,

have you got the solution for your JDBC
connection problem.

If you still have the problem and if you are using Java Webserver 2.0 , mail me the problem,
let me try to give you a solution.

My mail-id is xjali@yahoo.com

February 8th, 2000, 02:21 AM
Hi!!,
I have gone through your question. I have some points which might be giving
you an error.
* Have you given a data source name(dsn) for the backend.
* just try giving the sun.jdbc.odbc.JdbcOdbcDriver in codes("").
If your code is still not compiling, just forward the code to me so that I can
give it a try at the following id : arung@kpit.com

Bye!!
arun