This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

java.sql.SQLException

 
Krista Meek
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I am trying to connect to an Access database using the jdbc dbc bridge driver. When I run my database application I get the following error in the command line:
------------------------------------------------------------------------
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
------------------------------------------------------------------------

My code is below. Are there any suggestions on what I need to add to, or remove from, the code, or how I should access/name the database in the DriverManager.getConnection("....")? Does anything special need to be done to the database? I defined the fields in the table, and named it appropriately. (It's Access 2000, if that makes a difference.) I realize that there's some debugging left to be done to the code with respects to variables and stuff, but I'd like to at least get a connection.




Thanks!

[ December 09, 2005: Message edited by: Krista Meek ]
[ December 09, 2005: Message edited by: Krista Meek ]
 
Paul Clapham
Sheriff
Pie
Posts: 20764
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to go into your Windows control panel and find the place where you configure ODBC. On my Windows XP system it's under Administrative Tools. Set up a user DSN based on Access with the name "Assign5".

However... it doesn't make sense to use an Access database from an applet. Everybody who used your applet would have to download the MDB file and do the same configuration. And you would need to deal with the security issues about how an applet isn't normally allowed to read and write on the local file system. So hopefully that "ChatApplet" isn't actually an applet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic