aspose file tools*
The moose likes JDBC and the fly likes Converting from Access to MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Converting from Access to MySQL" Watch "Converting from Access to MySQL" New topic
Author

Converting from Access to MySQL

Jason Kwok
Ranch Hand

Joined: Mar 31, 2005
Posts: 126
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29240
    
139

Jason,
That should still work. Note that with MySQL, you are not tied to the ODBC driver. See this article for details.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting from Access to MySQL
 
Similar Threads
Transactions - JTA or JDBC?
Optimizing Database Connection ?
MySQL database connection fails after long idle
localhost to web server
MySQL can't connect with my driver