Updateable ResultSet just for doing inserts: good idea?
Jesper Ottosson
Ranch Hand
Joined: Mar 21, 2000
Posts: 51
posted
0
I hate it when my INSERT statements become horribly long. One thing that would solve this is querying for an empty updateable resultset from the table i want to insert into, and then use the update methods to specify the values (after doing a moveToInsertRow) Is this a good idea, or does it have serious performance implications? / Jesper
I find that PreparedStatements clean up a long insert statement:
instead of
I'm not a big fan of scrollable/updateable resultsets, but you could query your table for an empty ResultSet: "select * from emp where 1=2"...then move to insert row...etc but I'm not sure if you can have a where clause on the resultset if you want to insert into it(some drivers/DB's throw exceptions)
Jamie
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Updateable ResultSet just for doing inserts: good idea?