aspose file tools*
The moose likes JDBC and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark ""Data source name not found and no default driver specified"" Watch ""Data source name not found and no default driver specified"" New topic
Author

"Data source name not found and no default driver specified"

swati bathla
Greenhorn

Joined: Nov 25, 2012
Posts: 4
hi,

I am new at this forum and i am facing a problem in my project.Actually my project is on SuperMarket where i can add/remove products from database and place orders of customers who are already its member and it also calculates the bill but the problem is when i place id and other details of the customer it should display what are the products he buying and his bill but it displays nothing instead it writes(in General Output section as i m using creator) "Data source name not found and no default driver specified" and i think it is not connected to my database and i dont know how to connect database in 64bit Windows...so please help me as i need to submit my project which should be in execution within 2 days so please reply fast any help will be appreciated by me....Thankyou
Wayan Saryada
Ranch Hand

Joined: Feb 05, 2004
Posts: 105

You should post your code related on how you make connection. From the error message it is basically it cannot connect to the defined datasource name in your program. And it also cannot find the JDBC driver used by your program to connect to a database.


Website: Learn Java by Examples
swati bathla
Greenhorn

Joined: Nov 25, 2012
Posts: 4
Here's the code of my jdbc connection-

[Added code tags - see UseCodeTags for details]
Wayan Saryada
Ranch Hand

Joined: Feb 05, 2004
Posts: 105

I can see that you are using the JdbcOdbcDriver from your snippet. Now, have you created the Data Source in the ODBC Data Source manager? What database do you use? Microsoft Access?
swati bathla
Greenhorn

Joined: Nov 25, 2012
Posts: 4
Yes it's Microsoft Access
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

And you didn't create an ODBC data source named "NC" on the computer where that code ran, I suppose?
swati bathla
Greenhorn

Joined: Nov 25, 2012
Posts: 4
So what should i do now as i dont know how to do it?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1479
    
    6

In windows 7 you need to look here

Control Panel\System and Security\Administrative Tools

Under the above, you will find the following

ODBC Data Source Administrator

Select MS Access driver and click add, next window should show you the options to enter the dsn name you have used in your code and the access database file it should map too.




Swastik
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "Data source name not found and no default driver specified"