String sql2 = "create table ? (id int not null auto_increment, fullname
varchar(30) not null, primary key (id))";
PreparedStatement stmt2 = conn.prepareStatement(sql2);
stmt2.setString(1, username);
stmt2.execute();
stmt2.close();
von oben Anweisungen zu erstellen, ich erhielt Fehlermeldung ('John' als Tabellenname):Wie JDBC Platzhalter in PreparedStatement verwenden MySQL-Tabelle
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near ''john' (id int not null
auto_increment, fullname varchar(30) not null, primary ' at line 1
Eclipse sagt der Fehler in dieser Zeile ist:
stmt2.execute();
bitte helfen Jungs ... tq
Andere verwandte: http://stackoverflow.com/questions/25176860/how-to-pass-parameter-in-jdbc-query-for -creating-table –