The following code is what i'm using for the alter table, nothing special 
but it results in an exception:
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL 
statement "ALTER TABLE TableName ADD [*]? BOOLEAN"; expected "identifier"; 
SQL statement:
ALTER TABLE TableName ADD ? BOOLEAN [42001-214]

The code:
PreparedStatement preparedStatement = null;
try {
final String QUERY_SQL = "ALTER TABLE TableName ADD ? BOOLEAN";
preparedStatement = connection.prepareStatement(QUERY_SQL);
preparedStatement.setString(1, User.getUsername());
preparedStatement.executeUpdate();
preparedStatement.close();
} catch (SQLException e) {
...


For context: 
I'm trying to add a colum (of boolean) to the table named like the user and 
it works if i copy and paste the instruction on the browser and run it, am 
i missing something?

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/c7651d96-15fb-42e2-b4c1-bdee0ac1f2dan%40googlegroups.com.

Reply via email to