incubator-empire-db-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <>
Subject re: Why the connection is given two times in case of UPDATE?
Date Sun, 15 Aug 2010 21:04:00 GMT
Hi exxos,


In your update example the call to will read the record from the database by executing
a corresponding SELECT statement.

The UPDATE then only updates the changed fields.


It is part of our design, that we don't store connections since they are an external resource
that might be shared between threads or requests and hence a connection must be supplied every
time a database action is performed. But you may add your own layer (e.g. by deriving a class
from DBRecord) to implement a connection handling that suits your purpose.


If you don't want to read before an update - e.g. if you know that the value will change and
don't need the extra logic - then you should use a DBCommand to update a record. 






from: exxos [] 
re: Why the connection is given two times in case of UPDATE?




Sorry to spam the august's mailling list. ^__^


But, I need a clarification on the implementation for the INSERT and the UPDATE methods.


Accroding you tutorial, the following steps are needed:


DBRecord rec = new DBRecord();
rec.create(DBRowSet table);
rec.update(java.sql.Connection conn);


DBRecord rec = new DBRecord();, java.sql.Connection conn);
rec.update(java.sql.Connection conn);

Why in case of the UPDATE we have to give the Connection by two times?


Thank to advise,




View raw message