private void initCreateGameDBSchema() throws SQLException {
  ResultSet rs;
  rs=stmt.executeQuery("show tables from test like'tictactoc'");
  if (false == rs.next()) {
    String sql="CREATE TABLE tictactoc " + "(id varchar(10) not NULL, " + " win integer(1), "+ " defeat integer(1), "+ " playtimes integer(1), "+ " PRIMARY KEY ( id ),"+ "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8";
    stmt.executeUpdate(sql);
  }
  rs=stmt.executeQuery("show tables from test like'catchme'");
  if (false == rs.next()) {
    String sql="CREATE TABLE catchme " + "(id varchar(10) not NULL, " + " win integer(1), "+ " defeat integer(1), "+ " playtimes integer(1), "+ " PRIMARY KEY ( id ),"+ "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8";
    stmt.executeUpdate(sql);
  }
  rs=stmt.executeQuery("show tables from test like'meteor'");
  if (false == rs.next()) {
    String sql="CREATE TABLE meteor " + "(id varchar(10) not NULL, " + " win integer(1), "+ " defeat integer(1), "+ " playtimes integer(1), "+ " PRIMARY KEY ( id ),"+ "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8";
    stmt.executeUpdate(sql);
  }
  rs=stmt.executeQuery("show tables from test like'pangpang'");
  if (false == rs.next()) {
    String sql="CREATE TABLE pangpang " + "(id varchar(10) not NULL, " + " win integer(1), "+ " defeat integer(1), "+ " playtimes integer(1), "+ " score integer(10), "+ " PRIMARY KEY ( id ),"+ "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8";
    stmt.executeUpdate(sql);
  }
}

private void initCreateGameDBSchema ( ) throws SQLException { ResultSet rs ; rs = stmt . executeQuery ( "show tables from test like'tictactoc'" ) ; if ( false == rs . next ( ) ) { String sql = "CREATE TABLE tictactoc " + "(id varchar(10) not NULL, " + " win integer(1), " + " defeat integer(1), " + " playtimes integer(1), " + " PRIMARY KEY ( id )," + "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8" ; stmt . executeUpdate ( sql ) ; } rs = stmt . executeQuery ( "show tables from test like'catchme'" ) ; if ( false == rs . next ( ) ) { String sql = "CREATE TABLE catchme " + "(id varchar(10) not NULL, " + " win integer(1), " + " defeat integer(1), " + " playtimes integer(1), " + " PRIMARY KEY ( id )," + "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8" ; stmt . executeUpdate ( sql ) ; } rs = stmt . executeQuery ( "show tables from test like'meteor'" ) ; if ( false == rs . next ( ) ) { String sql = "CREATE TABLE meteor " + "(id varchar(10) not NULL, " + " win integer(1), " + " defeat integer(1), " + " playtimes integer(1), " + " PRIMARY KEY ( id )," + "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8" ; stmt . executeUpdate ( sql ) ; } rs = stmt . executeQuery ( "show tables from test like'pangpang'" ) ; if ( false == rs . next ( ) ) { String sql = "CREATE TABLE pangpang " + "(id varchar(10) not NULL, " + " win integer(1), " + " defeat integer(1), " + " playtimes integer(1), " + " score integer(10), " + " PRIMARY KEY ( id )," + "FOREIGN KEY (id) REFERENCES userinformation (id)) Engine=Innodb default charset = utf8" ; stmt . executeUpdate ( sql ) ; } }
init database system for gamedb
