Beispiel #1
0
 @Ignore
 @Test
 public void shouldConnectToEmptyDatabase() throws SQLException {
   try (MySQLConnection conn = MySQLConnection.forTestDatabase("emptydb"); ) {
     conn.connect();
   }
 }
Beispiel #2
0
 @Ignore
 @Test
 public void shouldConnectToDefaulDatabase() throws SQLException {
   try (MySQLConnection conn = MySQLConnection.forTestDatabase("mysql"); ) {
     conn.connect();
   }
 }
Beispiel #3
0
 @Test
 public void shouldDoStuffWithDatabase() throws SQLException {
   try (MySQLConnection conn = MySQLConnection.forTestDatabase("readbinlog_test"); ) {
     conn.connect();
     // Set up the table as one transaction and wait to see the events ...
     conn.execute(
         "DROP TABLE IF EXISTS person",
         "CREATE TABLE person ("
             + "  name VARCHAR(255) primary key,"
             + "  birthdate DATE NULL,"
             + "  age INTEGER NULL DEFAULT 10,"
             + "  salary DECIMAL(5,2),"
             + "  bitStr BIT(18)"
             + ")");
     conn.execute("SELECT * FROM person");
     try (ResultSet rs =
         conn.connection().getMetaData().getColumns("readbinlog_test", null, null, null)) {
       // if ( Testing.Print.isEnabled() ) conn.print(rs);
     }
   }
 }