You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@empire-db.apache.org by exxos <ha...@gmail.com> on 2010/08/15 17:14:36 UTC

Centralize methods on the DB object

Hi,

// SELECT
DBCommand cmd = db.createCommand();

Why there is no equivalances of above for the UPDATE and the INSERT?

DBCommand cmd = db.insertCommand();
DBCommand cmd = db.updateCommand();

Regards.

re: Centralize methods on the DB object

Posted by Rainer Döbele <do...@esteam.de>.
Hi exxos,

 

A command-object may be used for SELECT, UPDATE and INSERT.

You then decice what kind of command you want to be generated by calling on of the following functions:

 

// SELECT

String sql = cmd.getSelect();

// UPDATE

String sql = cmd.getUpdate();

// INSERT

String sql = cmd.getInsert();

// INSERT INTO

String sql = cmd.getInsertInto(...);

 

Regards

Rainer

 

 

from: exxos [mailto:hatufr@gmail.com] 
to: empire-db-user@incubator.apache.org
re: Centralize methods on the DB object

 

Hi,

 

// SELECT
DBCommand cmd = db.createCommand();

 

Why there is no equivalances of above for the UPDATE and the INSERT?

 

DBCommand cmd = db.insertCommand();
DBCommand cmd = db.updateCommand();

 

Regards.