user2916888
user2916888

Reputation: 83

JDBC SQL Exception Data Source not found in servlets

I have created a database : Admission.mdb, and added it to the user DNS : "adm" When I try to access it through java program, I use following code to connect the database

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:adm");

It worrks properly, and the program can access the database. But, when I tried to use the same code inside a servlet, it gives following Exception: "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" Can someone tell me what am I doing wrong?

Upvotes: 0

Views: 1319

Answers (1)

perencia
perencia

Reputation: 1542

You need to indicate where the mdb file is (and what is its name). Take a look at this

Upvotes: 0

Related Questions