com.nonesole.persistence.sql
Class PreparedStatementOperations

java.lang.Object
  extended by com.nonesole.persistence.sql.PreparedStatementOperations
All Implemented Interfaces:
ISQLOperations

public class PreparedStatementOperations
extends java.lang.Object
implements ISQLOperations

Deal with object with blob.

Version:
1.0 - build in 2009-07-26
Author:
JACK LEE

Method Summary
 void batchDelete(java.util.List<java.lang.Object> obj, java.sql.Connection conn)
          Delete list of objects in database
 java.util.List<java.lang.Object> batchInsert(java.util.List<java.lang.Object> obj, java.sql.Connection conn)
          Insert list of objects to database
 java.util.List<java.lang.Object> batchUpdate(java.util.List<java.lang.Object> obj, java.sql.Connection conn)
          Update list of objects in database
 void delete(java.lang.Object obj, java.sql.Connection conn)
          Delete one object in database
 void execute(java.lang.String sql, java.sql.Connection conn)
          Execute sql (it would be insert,update,delete sql)
static PreparedStatementOperations getInstance()
           
 java.lang.Object insert(java.lang.Object obj, java.sql.Connection conn)
          Insert one object to database
 java.util.List<java.lang.Object> query(java.lang.String sql, java.lang.Class<?> clazz, java.sql.Connection conn)
          Search objects in database
 java.lang.Object update(java.lang.Object obj, java.sql.Connection conn)
          Update one object in database
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PreparedStatementOperations getInstance()

batchDelete

public void batchDelete(java.util.List<java.lang.Object> obj,
                        java.sql.Connection conn)
                 throws OperationsException
Description copied from interface: ISQLOperations
Delete list of objects in database

Specified by:
batchDelete in interface ISQLOperations
Throws:
OperationsException

batchInsert

public java.util.List<java.lang.Object> batchInsert(java.util.List<java.lang.Object> obj,
                                                    java.sql.Connection conn)
                                             throws OperationsException
Description copied from interface: ISQLOperations
Insert list of objects to database

Specified by:
batchInsert in interface ISQLOperations
Returns:
list of object
Throws:
OperationsException

batchUpdate

public java.util.List<java.lang.Object> batchUpdate(java.util.List<java.lang.Object> obj,
                                                    java.sql.Connection conn)
                                             throws OperationsException
Description copied from interface: ISQLOperations
Update list of objects in database

Specified by:
batchUpdate in interface ISQLOperations
Returns:
list of object
Throws:
OperationsException

delete

public void delete(java.lang.Object obj,
                   java.sql.Connection conn)
            throws OperationsException
Description copied from interface: ISQLOperations
Delete one object in database

Specified by:
delete in interface ISQLOperations
Throws:
OperationsException

execute

public void execute(java.lang.String sql,
                    java.sql.Connection conn)
             throws OperationsException
Description copied from interface: ISQLOperations
Execute sql (it would be insert,update,delete sql)

Specified by:
execute in interface ISQLOperations
Throws:
OperationsException

insert

public java.lang.Object insert(java.lang.Object obj,
                               java.sql.Connection conn)
                        throws OperationsException
Description copied from interface: ISQLOperations
Insert one object to database

Specified by:
insert in interface ISQLOperations
Returns:
object
Throws:
OperationsException

query

public java.util.List<java.lang.Object> query(java.lang.String sql,
                                              java.lang.Class<?> clazz,
                                              java.sql.Connection conn)
                                       throws OperationsException
Description copied from interface: ISQLOperations
Search objects in database

Specified by:
query in interface ISQLOperations
clazz - - Class of object
Returns:
object
Throws:
OperationsException

update

public java.lang.Object update(java.lang.Object obj,
                               java.sql.Connection conn)
                        throws OperationsException
Description copied from interface: ISQLOperations
Update one object in database

Specified by:
update in interface ISQLOperations
Returns:
object
Throws:
OperationsException