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

Converting from Access to MySQL

 
Jason Kwok
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've just converted my database from Access to MySQL because I'm running on Linux now.

My question is, are there any changes needed in the servlet code when making a connection to a MySQL database in comparison to an Access database?

Using Access, I would include this in my servlet to make a connection:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbcdbc:jTunesDB"; //jTunesDB is the database name.
Connection connection = DriverManager.getConnection(url,"","");

and previously in my Windows machine, I would go into ODBC setting in my control panel and set the path where the Access database was stored.


If anyone can help me with this, I would greatly appreciate it.

Thanks,
Jason
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason,
That should still work. Note that with MySQL, you are not tied to the ODBC driver. See this article for details.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic