I'm using a prepared statment that should (using SQL & JDBC) insert data into a dataTable. I am using one that deletes data that works fine, but the insert one is not inserting any data into the data table and does not produce an error or warning. What could cause a prepared statement to fail in this way? Could inserting a null value into the prepared statement cause this?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Two ways to solve your problem.
1st way:
2nd way:
That is while creating connection object itself enable autocommit true for it. So tat it ll make the changes immediately reflect into ur database.
Else after ur transaction make the connection as commit to ensure your transaction to be saved in database
What do you mean by "failing, but does not produce an error"? How do you know it's failing then - is data not actually being inserted? Perhaps you're not committing a transaction?