Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.82 KB | None | 0 0
  1. import core.database.MySQL;
  2.  
  3. public class Program {
  4.     public static void main(String args[]) {
  5.         /*if(MySQL.Open("localhost", "test", "root", "")) {
  6.             System.out.println("Successfully connected to mysql database!");
  7.         } else {
  8.             System.exit(0);
  9.         }*/
  10.        
  11.         /*MySQL.Insert("dudes", new String[]{"first_name", "last_name"}, new String[]{"asib", "tayeb"});
  12.         System.out.println("Inserted into database!");*/
  13.        
  14.         /*MySQL.Query("UPDATE dudes SET first_name = 'jaweed' WHERE id = 1");
  15.         System.out.println("Updated database!");*/
  16.        
  17.         String[][] results = MySQL.Read("dudes", new String[]{"id", "first_name", "last_name"}, null, null, 0);
  18.         for(int i = 0; i < results.length; i++) {
  19.             for(int x = 0; x < results[i].length; x++) {
  20.                 System.out.printf("%s ", results[i][x]);
  21.             }
  22.            
  23.             System.out.println();
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement