How to connect mysql database in java program

Before creating a java program first we create databse in mysql database program.

First  open mysql software program.

Now open MYSQL CommandLine Client
In CommandLine Client follow the steps  for create database

step-1 :  Enter Passwrod : root

step-2 :  mysql >create database mydatabase;
query Ok, 1 row effected (0.05 sec)

Java Source COde Program to connect with MySQL Database

Output  see on eclipse

run As Java Application

Connection successful

(Visited 12 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

Reload Image