Re: Java SQL interface



Am I getting this correct?

if the DB internally makes use of parameterised statements,

Query2 is re-useable and not query 1 for a variety of insert values.
But, the PreparedStatement APi from Java guarantees re-use only if the
DB allows parameterised Queries. Else, the Query2 might have to be
compiled for execution again.
Query 1
insert into test_table values('1','2');
Query 2
insert into test_table values('?,?);


A SQL statement is precompiled and stored in a PreparedStatement object ( from the API docs)
The precompiled version stays on the DB. The API guarantees re-use only
depending on the DB

Which brings me to wonder , how exactly does executeBatch() method
work? How do the queries get transported to the DB cache in one go?

.



Relevant Pages

  • Re: Finally which ORM tool?
    ... Also, if you pass a variable to the query, the value the ... you have a linq query and by changing the variable's value, ... q is affected if I change foo AFTER this query and BEFORE execution. ... And it is a declaration, but one which captures the variables. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finally which ORM tool?
    ... the session' method. ... able to execute the query by itself. ... has at EXECUTION time is used, ... That SHOULDN'T be important, simply because q LOOKS like a declaration, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Finally which ORM tool?
    ... the session' method. ... they use the same mechanism as Linq to Sql does: ... Also, if you pass a variable to the query, the value the variable ... q is affected if I change foo AFTER this query and BEFORE execution. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: One Insert statement, no looping, creates 2 records?
    ... Is there any chance a distributed query is involved? ... you can see this when the first execution generates the ... >REALLY odd, tho, is that the debug display only shows once, even tho it's ... and the debug display ...
    (microsoft.public.sqlserver.programming)
  • Re: As a generale rule - Query or VBA?
    ... I agree with you Rick, I was recently working on a database that had ... the query is saved, then JET will save the fastest execution path. ...
    (comp.databases.ms-access)