How to connect Java Eclipse to MySQL Server?

JDBC connectivity to MySQL Server


1.Download MySQL JDBC Driver from

2.  After downloading the zip file, extract it and add this .rar file to lib folder of eclipse project.
  learn how to add .rar file to the eclipse folder by following the steps(1-5) from this post.

3.Make a class file and paste the following code.

import java.sql.*;
//import the all valuable stuffs frm SQL

public class driver {

public static void main(String[] args) {
// TODO Auto-generated method stub

//Get connection
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/new","root","root");
// here , new is the name of database that i created from MySQL Workbench, first root is my username of sql server and second root is my password. 
// make statement
Statement st=con.createStatement();
//execute sql query
ResultSet rs=st.executeQuery("select * from new_table");
// new_table is the name of my table that i have created from the MySQL Server Workbench.
//process result set
// name is the column name of my table.
}catch( Exception exc){


How to find the similarity between two words in java using wordnet? 

No comments:

Post a comment

All about journals and research paper | What is impact factor? | how the impact factor is calculated? | who calculate the impact factor? Scopous journals

Figure 1: One of my Research Papers When the Scholars are in their Master or PhD or in any research field. They are supposed to writ...