File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Converting from Access to MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply 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: 26144
    
  66

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://zeroturnaround.com/jrebel/download
 
subject: Converting from Access to MySQL
 
Similar Threads
Optimizing Database Connection ?
Transactions - JTA or JDBC?
localhost to web server
MySQL database connection fails after long idle
MySQL can't connect with my driver