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 Main
- {
- public static void main(String[] args) throws Exception
- {
- Class.forName("com.mysql.jdbc.Driver");
- Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/Login System","root","");
- PreparedStatement statement = con.prepareStatement("select * from `Login System` `name`");
- ResultSet result = statement.executeQuery();
- while(result.next())
- {
- System.out.println(result.getString(1) + " " + result.getString(2));
- }
- }
- }
Add Comment
Please, Sign In to add comment