0
Code I’m using
PreparedStatement i = conexao.prepareStatement("INSERT INTO teste VALUES (player='teste', level_1=0, level_2=0, level_3=0, level_4=0, level_5=0, level_6=0, level_7=0, level_8=0, level_9=0, level_10=0)");
i.executeUpdate();
Table structure.
It just happens with the Insert into
, I’ve used this same code to create the table and no problem, this simply does not insert, what is the problem?
Don’t make any mistakes, nothing, just don’t insert.
What went wrong? Does it give a Sqlexception? Does it do anything? Does it insert anything other than what it should insert? Did he manage to connect to the database? I don’t see anything wrong with the little code you provided, maybe the problem is somewhere else.
– Victor Stafusa
Name the columns tbm and not only the value.
– rray
@rray But he put. See the SQL statement.
– Victor Stafusa
@Victorstafusa, I understood is that update format Insert, by the image it seems that all values are in a column.
– rray
@rray "this simply does not insert"
– user22408
If you copy the Insert and test directly in the bank it works? or any error?
– rray
@rray works perfectly.
– user22408
Using mysql? using transfer? auto commit is on?
– rray
yes, I don’t know what that is, and the auto commit I left false.
– user22408
does a test, leaves auto commit
true
, ai whenever you send a query in the bank will be applied on time. Already with auto commitfalse
you need to tell the bank to perform the operation (Insert, update, delete) successfully usecommit
and for failurerollback
.– rray
@rray left true and worked perfectly. Thank you.
– user22408
This question is very superficial, more information is needed.
– Delfino
@Delfino has already been solved.
– user22408
@Leonardosnt, I understand, but it would be interesting to adjust the question, keeping the site organized. Making it easier for others to gain access to information.
– Delfino