Register / Login
File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of
Clojure in Action
this week in the
JDBC and Relational Databases
Sql Jdbc Questions
friki data migration
posted 1 month ago
for non-SQL specific JDBC questions. Or ask in the
. Also see
Q. How do I batch statements to reduce roundtrips?
For inserts/updates, it is easy - JDBC provides an executeBatch() method. For select statements, it requires a bit of engineering.
Batching Select Statements
has a good discussion on the topic
Q. How do I insert if the record doesn't exist and update if it does?
SQL merge statement
does this "or" operation. If the row exists, it does an update. Otherwise it inserts a row.
I agree. Here's the link:
Sql Merge Statement
insert before update
inserting repeated values in primary key field
Comparing parameters values with db values
JDBC Batch insert exception handling