Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
swati bathla
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
swati bathla
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the code of my jdbc connection-

[Added code tags - see UseCodeTags for details]
 
Wayan Saryada
Ranch Hand
Posts: 105
IntelliJ IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it's Microsoft Access
 
Paul Clapham
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you didn't create an ODBC data source named "NC" on the computer where that code ran, I suppose?
 
swati bathla
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what should i do now as i dont know how to do it?
 
Swastik Dey
Rancher
Posts: 1603
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic