Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing from MSAccess to MySQL

 
basappa jodalli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Pawan Ramchandani
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]";
 
basappa jodalli
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 405
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic