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.
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.
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.
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
Joined: Sep 03, 2003
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.