Can we insert into the database without using INSERT Query in a ResultSet into the database. The option I thought was using Stored Procedure. Is there any other way we could do this. Please let me know.
I'm not sure I entirely understand the question, but I'll take a stab at it.
There are a few ways you can get data into a database via JDBC and SQL.
Using pure standard SQL, the SQL INSERT statement is the major way. For example, "INSERT INTO MY_TABLE (MY_COL_1, MY_OTHER_COL) values ('test', 3)"; For greater efficieny, inserts may be batched together with the batch facilities of PreparedStatement (if supported by your driver/database).
If your database supports stored procedures (SPs), then you can have them do the sql INSERT for you - it still does an INSERT (or whatever you program in the SP), you're just adding a layer of abstraction around it.
Some databases also support some non-standard SQL statments, some of which can add new data. For example, Oracle's MERGE statement will allow you to do INSERT-or-UPDATE in a single query.
Some databases and their drivers support updatable ResultSets (which you appear to be aware of), but not all do or do it well/efficiently.
Joined: May 05, 2005
I phrased the question wrong. Thanks though...
subject: Can you insert into the database without using insert query in a Resultset