Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package sqltest;
- import java.sql.*;
- /**
- *
- * @author Abdullah
- */
- public class Display {
- public static void main(String[] args) throws SQLException{
- String url="jdbc:mysql://localhost:3306/hawk?autoReconnect&useSSL=false";
- Connection con=DriverManager.getConnection(url,"root","abdullah");
- Statement NS=con.createStatement();
- ResultSet Output=NS.executeQuery("SELECT * FROM table1");
- while(Output.next()){
- System.out.println(Output.getString("ID")+"\t"+Output.getString("NickName"));
- }
- }
- }
Add Comment
Please, Sign In to add comment