This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Changing from MSAccess to MySQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Changing from MSAccess to MySQL" Watch "Changing from MSAccess to MySQL" New topic
Author

Changing from MSAccess to MySQL

basappa jodalli
Greenhorn

Joined: Mar 30, 2004
Posts: 3
i am currently using MSAccess as database for a Web application using JSP.
i would like to change to MySQL.
anybody pls let me know
what version of MySQL to be used?
how to connect to MySQL?
how to create tables in MySQL?
how to carry out primitive operations like insert,delete,select,update etc from frontend like JSP with MySQL as database.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

Nothing to do with JSP per se, so I'm moving this off to the JDBC forum.
[ March 30, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Pawan Ramchandani
Ranch Hand

Joined: Aug 15, 2003
Posts: 78
Hi,
you can work on mysql 4.0 and can download it from http://www.mysql.com/downloads/mysql-4.0.html
all the functionality is the same you will find change in the data type
and to connect from jsp download driver class and use follwing string to fet connect with database.

DBDRIVERCLASS="net.sourceforge.jtds.jdbc.Driver";
DBURL="jdbc:jtds:sqlserver://[servername]:[portnumber]/[databasename]";


Pawan Ramchandani<br />*******************************<br />SCJP 1.4<br />SCWCD <br />*******************************<br />Everything is okay in the end. If it's not okay, then it's not the end.
basappa jodalli
Greenhorn

Joined: Mar 30, 2004
Posts: 3
Thanx a lot
i got MySQL
but i don't know how to make ODBC connection for MySQL
i m doing a project on it.
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
You don't use ODBC to connect to MySQL. You use a type-4 (native) driver that you can download from: MySQL JDBC driver. Extract the ZIP file and you should have a jar file named "mysql-connector-java-3.0.11-stable.bin.jar". Make sure that the jar file is in your class path.
The driver class is: "com.mysql.jdbc.Driver".
The URL is: "jdbc:mysql://host-name/database-name". "host-name" is the DNS name or IP-address of the database (or "localhost" if it's running on the same machine). The "database-name" is optional, and refers to the database you are connecting to. You can pass in the user and password on the URL or as separate parameters, and there are lots of other parameters you can use. Check out the mysql documentation for more details.
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
Also keep in mind that MySQL listens to port 3306 by default. I am not sure is this can be changed, I guess you can check the documentation.
But anyway the URL of the connection string would be something similar to:

I hope this helps.
Craig
Wayne L Johnson
Ranch Hand

Joined: Sep 03, 2003
Posts: 399
You only need to specify the port if you have changed the default (3306), which is why I left it off in my previous post. So these are equivalent:
jdbc:mysql://host-name/database-name
jdbc:mysql://host-name:3306/database-name
unless you've configured MySQL differently, in which case you'd have to specify the port.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing from MSAccess to MySQL
 
Similar Threads
How to connect Msaccess from myeclipse
JDBC
MS Access query
JDBC
How to connect msaccess database from myeclipse IDE tools