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

Data source name not found and no default driver specified

 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am getiing above said error. Saying SQLException...


Thanking in advance...


[BSouther: Added UBB CODE tags]
[ April 09, 2007: Message edited by: Ben Souther ]
 
Talhah Mafawalla
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi amit,

Did you create a DSN before you ran the code.

To create a DSN called "TEST" do the following:
1. Click Start in windows and select run or open comand promt.
2. Type "odbcad32" and press enter.
3. When the "ODBC data source administrator" opens click on "Add".
4. In the window "Create new data source" select "Microsoft Access Driver (*.mdb)" then click finish
5. In the window "ODBC Microsoft access setup", type "TEST" into the "Data source name" text box.
6. Next click "Select" under "Database", then browse and select you Microsoft access databse and click "Ok".
7. Then click "Ok" on the "ODBC Microsoft access setup" window.
8. Then click "Ok" on the "ODBC data source administrator" window.
9. Re run the page.

I hope this is what you were looking for.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the ODBC-JDBC bridge ships with Java, there is nothing particular to Servlets or JSP that needs to be done when using it.
For this reason, I think this issue really belongs in the JDBC forum.
Moving....
 
Jeff Ash
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple of important notes about ODBC DSN's:

First, make sure that you create a "System" DSN whenever the calling code is located inside a service. Since you're using a Web server (Tomcat or something similar I assume?) and thus probably running it as a service, you need to make sure your DSN is a System DSN, NOT User. The service cannot access a user DSN unless you happen to create the user DSN as the same user that the service is running as. However, it's best just to make it a system DSN. Also, you can use a File DSN if you need to, as they work like system DSNs.

Second, DSN names are case sensitive. So, if your DSN is named "Test" and you try to use the connect URL of jdbcdbc:TEST, it will fail.
 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I created DSN as told by discussion.Still its not connecting? Whats might be the problem...Is it CLASSPATH variable problem or any other?



thanking in advance...
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by amit bhadre:

I am getiing above said error. Saying SQLException...


It would be better if you test your code by running a .class file. create a java file with your database connection code then test it.

and one more thing paste your stack trace here whatever you are getting in SQLException. it could be more help to find out the error shortly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic