+1

java

how can I connect java with my database Sql?

4/7/2019 8:40:16 PM

kaleab

2 Answers

New Answer

+10

You need JDBC then set it's path as class path now import java.mysql.*; In class try { Class.forName("com.mysql.jdbc.Driver");   Connection con=DriverManager.getConnection(  "jdbc:mysql://localhost:3306/sonoo","root","root");   //here sonoo is database name, root is username and password   } catch (exception exc){ exc.printStackTrace(); }

0

Thanks