mysql - create any table name with prepareStatement jdbc java -
this question has answer here:
- jdbc preparestatement doesn't work 4 answers
so i'm trying create unspecified table name unspecified columns, however, i'm new preparestatement , i'm not sure do. how i'm thinking know i'll need loop multiple entries of "line" table name how can deal columns? think i'm specifying number of columns in here (4). how can without specifying? , should put setstring if value differ based on table name? i'm kind of confused , hoping explain me
loop start .... line = kb.next(); sql = "create table " + line + "(?,?,?,?)"; pstmt = conn.preparestatement(sql); pstmt.setstring(1,?); pstmt.executeupdate(); loop end
it's unlikely you'll able work on database.
for oracle-specific reasoning, see why cannot use bind variables in ddl?
Comments
Post a Comment