Detta borde fungera i ditt fall:
statement.executeUpdate("DROP TABLE IF EXISTS account ");
statement.executeUpdate("CREATE TABLE account ( "
+"accountNum INT( 11 ),"
+"dateCreated DATE NOT NULL,"
+"accountName TEXT,"
+"description TEXT,"
+"statusAccount TEXT,"
+"sumOfMoney INT( 11 ) NOT NULL DEFAULT 0 )" ) ;
Orsak:Påståenden kan endast exekvera en SQL-sats med varje anrop av exekveringsmetoderna.
Om du vill köra två eller flera satser samtidigt kan du göra detta med Batch-Jobs.
Som:
statement.addBatch("DROP TABLE IF EXISTS account ");
statement.addBatch("CREATE TABLE account ( "
+"accountNum INT( 11 ),"
+"dateCreated DATE NOT NULL,"
+"accountName TEXT,"
+"description TEXT,"
+"statusAccount TEXT,"
+"sumOfMoney INT( 11 ) NOT NULL DEFAULT 0 )" ) ;
statement.executeBatch();