2
How to connect mysql with java program in command prompt? Steps: 1. First, you have to install mysql server, that is wamp server or xamp server. 2. Then, you have to start wampserver or xamp server. 3. Then, you have to create some database. 4. Then, you need a jdbc driver for connecting mysql to java program. That would be installed by yourself. If you need the file, then go to www.mysql.com . 5. Then, that installed file contains an jar file like, named as mysql-connector-java-5.1.35-bin.jar. 6. That would be copied by yourself and paste it on the place where you install your java file named as jdk1.7.0 or 8.0 or something. In that, jdk1.7.0/jre/lib/ext path would be selected by yourself and copy the connector file. 7. Then, the program would be compiled and executed successfully. 8. Or otherwise, you need to set the path in your command prompt like this. set classpath="c:\Program Files\Java\jdk1.5.0_07\jre\lib\ext\ mysql-connector-java-5.1.35-bin.jar"; This is the way to connect mysql database in your basic java program. How to connect mysql with java program in netbeans? Steps: 1. In this also, having the same first 5 steps would be done by yourself, which would be given above. 2. Then, go to your netbeans ide and in that, which project you need the connection.

basics of java programming.doc

Embed Size (px)

Citation preview

How to connect mysql with java program in command prompt?Steps:1. First, you have to install mysql server, that is wamp server or xamp server.2. Then, you have to start wampserver or xamp server.3. Then, you have to create some database.4. Then, you need a jdbc driver or connectin! mysql to java pro!ram. That would be installed by yoursel. " you need the #le, then !o to www.mysql.com.$. Then, that installed #le contains an jar #le li%e, named as mysql&connector&java&$.1.3$&bin.jar.'. That would be copied by yoursel and paste it on the place where you install your java #le named as jd%1.(.) or *.) or somethin!. "n that, jd%1.(.)+jre+lib+ext path would be selected by yoursel and copy the connector#le.(. Then, the pro!ram would be compiled and executed successully.*. ,r otherwise, you need to set the path in your command prompt li%e this.set classpath-.c/01ro!ram Files02ava0jd%1.$.)3)(0jre0lib0ext0mysql&connector&java&$.1.3$&bin.jar.4This is the way to connect mysql database in your basic java pro!ram.How to connect mysql with java program in netbeans?Steps:1. "n this also, havin! the same #rst $ steps would be done by yoursel, which would be !iven above.2. Then, !o to your netbeans ide and in that, which project you need the connection.3. 5elect the project, in that contains an libraries older that would be !iven below in a pictorial ormat.4. "n that, you have to add your jar #le mysqlconnector.$. Then your project would contain the jar #le.This is the way to connect mysql database in java throu!h netbeans ide.