• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Data source name not found and no default driver specified

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 jdbc:odbc:TEST, it will fail.
 
amit bhadre
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic