Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.PreparedStatement;
- import java.sql.ResultSet;
- public class Test_Database {
- public static void main(String[] args) {
- Connection con;
- PreparedStatement ps;
- ResultSet rs;
- try
- {
- Class.forName("com.mysql.jdbc.Driver");
- con=DriverManager.getConnection("jdbc:mysql://localhost/","root",""); //check for running server
- System.out.println("Server Connected");
- }
- catch(Exception e)
- {
- System.out.println(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment