Skip to content
Advertisement

Connecting to MySQL database using Java in command prompt

Since I don’t have netbeans right now, I am trying to connect to MySQL database from my Java code through command prompt. But it it is not taking the mysql-coonectivity.jar file.

Does anyone know any way to run my program??? Please help.

Advertisement

Answer

Try executing the program as it is windows OS

java -cp .;pathofyourmysql-connector-java-5.1.6.jar className

In case you don’t have the mysql-connector-java-[version].jar get it from here

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement