有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

JAVA&MySQL不需要的额外列

因此,基本上我创建了一个数据库,其中包含一个表(仅用于测试目的),有2个元素(第一个VARCHAR(255)和age INTEGER),如下所示:

protected void createTableExamPeriod() throws SQLException {
    //STEP 4: Execute a query
      System.out.println("Creating table in given database...");
      stmt = conn.createStatement();

      String drop = "DROP TABLE IF EXISTS REGISTRATION ";
      String table = "CREATE TABLE IF NOT EXISTS REGISTRATION " +
                   " (first VARCHAR(255), " + 
                   " age INTEGER )"; 

      stmt.executeUpdate(drop);
      stmt.executeUpdate(table);
      populateExamPeriodTable();
      System.out.println("Created table in given database...");
}

但当我在数据库中查看时,有一个额外的列,称为“New”: enter image description here

所以我的问题是,我如何摆脱这个额外的列,因为现在,我不能在其中插入“正确”数量的参数,因为这个额外的列,当我这样做时:

protected void populateExamPeriodTable() throws SQLException {
    Statement stmt = conn.createStatement();
    String insertSql = "INSERT REGISTRATION VALUES(3 + 2 + 5)";

    stmt.executeUpdate(insertSql);
}

共 (1) 个答案

  1. # 1 楼答案

    New不是新列PHPMyAdmin显示它以图形方式添加新列