Example #1
0
  public static void main(String[] args) throws SQLException {
    // Create a new DataSource (MySQL specifically)
    /* ds = new MysqlDataSource();
    ds.setUrl("jdbc:mysql://localhost:3306/");
    ds.setUser("root");
    ds.setPassword("");
    connect = ds.getConnection();
    statement = connect.createStatement();
    String query = "SELECT * FROM employees";

    // Execute the query and get the result set.
    ResultSet resultSet = statement.executeQuery(query);
    while(resultSet.next()){
     String employeeName = resultSet.getString("first_name");
     System.out.println(employeeName);
    }*/

    DatabaseManager.initDataBase();
    System.out.println("Finished.");
  }