pase.server
Class DBServiceImpl

java.lang.Object
  extended by pase.server.DBServiceImpl
All Implemented Interfaces:
DBService

public class DBServiceImpl
extends java.lang.Object
implements DBService

DBService Implementation

Version:
2.0.0,
Author:
lchuang
See Also:
DBService

Constructor Summary
DBServiceImpl()
           
 
Method Summary
 int addNewSessionConnectionURL(int type, java.lang.String name, java.lang.String dburl, java.lang.String username, java.lang.String password)
          Add a new db URL to db configuration, and return its sequence number
 int addNewSessionConnectionURL(int type, java.lang.String name, java.lang.String dburl, java.lang.String username, java.lang.String password, int minConnCount, int maxConnCount)
          Add a new db URL to db configuration, and return its sequence number
 int addNewSessionConnectionURL(int type, java.lang.String name, java.lang.String dburl, java.lang.String username, java.lang.String password, int minConnCount, int maxConnCount, boolean isSession3X)
          Add a new db URL to db configuration, and return its sequence number
 void addSessionConnectionURL(int seq, int type, java.lang.String dburl, java.lang.String username, java.lang.String password)
          Add a db URL to db configuration, and specify its sequence number in it.
 void addSessionConnectionURL(int seq, int type, java.lang.String name, java.lang.String dburl, java.lang.String username, java.lang.String password)
          Add a db URL to db configuration, and specify its sequence number in it
 void addSessionConnectionURL(int seq, int type, java.lang.String name, java.lang.String dburl, java.lang.String username, java.lang.String password, int minConnCount, int maxConnCount)
          Add a db URL to db configuration, and specify its sequence number in it
 void addSessionConnectionURL(int seq, int type, java.lang.String name, java.lang.String dburl, java.lang.String username, java.lang.String password, int minConnCount, int maxConnCount, boolean isSession3X)
          Add a db URL to db configuration, and specify its sequence number in it
 java.util.List ArtSQLloadValue(java.lang.String sql)
          Database query for artifact data
 int[] batchSQLupdateValue(java.lang.String[] sql)
           
 int[] batchSQLupdateValue(java.lang.String sql, org.springframework.jdbc.core.BatchPreparedStatementSetter bpss)
           
 void closeAllSessionConnection()
          Close a SessionConnection object
 void closeOpenedSessionConnection()
          Close all SessionConnection object opened by current thread
 void closeSessionConnection(java.lang.String session)
          Close a SessionConnection object
 void closeSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session)
           
 void commitSessionConnection(java.lang.String session)
          Make commit on the connection
 void commitSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session)
           
 SessionConnection createSessionConnection(int sequence)
          Create a SessionConnection
 SessionConnection createSessionConnection(java.lang.String name)
          Create a SessionConnection
 boolean delete(java.lang.String sqlcmd)
          Database delete
 boolean delete(java.lang.String sqlcmd, java.util.Vector record, java.util.Vector columnTypeList)
          Database delete
 java.util.HashMap deleteSessionConnectionURL(java.lang.String name)
          Remove a db URL from db configuration by given name, return the configuration which has been deleted
 java.util.HashMap getSessionConnectionURL(int sequence)
          Get the db configuration info with the specific sequence number
 java.util.HashMap getSessionConnectionURL(java.lang.String name)
          Get the db configuration info with the specific name
 java.util.HashMap getSessionConnectionURL(java.lang.String ip, java.lang.String port, int sequence)
           
 java.util.HashMap getSessionConnectionURL(java.lang.String ip, java.lang.String port, java.lang.String name)
           
 java.util.Vector getSessionConnectionURLList()
          Get the db configuration info list
 boolean insert(java.lang.String sqlcmd, java.util.Vector record, java.util.Vector columnTypeList)
          Database insert
 boolean isConnectFailure(java.lang.Throwable ex)
           
 java.util.Vector loadValueWithSessionConnection(java.lang.String session, java.lang.String sqlcmd)
          Invoke the connection to load value
 java.util.Vector loadValueWithSessionConnection(java.lang.String session, java.lang.String sqlcmd, java.lang.Object[] args)
           
 java.util.Vector loadValueWithSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session, java.lang.String sqlcmd)
           
 java.util.Vector loadValueWithSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session, java.lang.String sqlcmd, java.lang.Object[] args)
           
 java.util.HashMap query(java.lang.String sqlcmd)
          Database query
 java.util.HashMap query(java.lang.String sqlcmd, int top)
          Database query, specify the result number
 java.util.HashMap query1(java.lang.String sqlcmd)
          Database query
 void rollbackSessionConnection(java.lang.String session)
          Make rollback on the connection
 void rollbackSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session)
           
 void setRmiServer(RMIServer rmiServer)
           
 void setSessionConnectionManager(com.flowring.manager.SessionConnectionManager sessionConnectionManager)
           
 boolean SQLdeleteValue(java.lang.String sql)
          The method is used to delete value from database (the RTRepository)
 boolean SQLdeleteValue(java.lang.String sql, java.lang.Object[] args)
           
 boolean SQLinsertValue(java.lang.String sql)
          The method is used to insert value to database (the RTRepository)
 boolean SQLinsertValue(java.lang.String sql, java.lang.Object[] args)
           
 java.util.List SQLloadValue(java.lang.String sql)
          The method is used to load value from database (the RTRepository)
 java.util.List SQLloadValue(java.lang.String sql, java.lang.Object[] args)
           
 boolean SQLupdateValue(java.lang.String sql)
          The method is used to update value to database (the RTRepository)
 boolean SQLupdateValue(java.lang.String sql, java.lang.Object[] args)
           
 boolean testSessionConnection(int sequence)
          Test a SessionConnection
 boolean testSessionConnection(java.lang.String name)
          Test a SessionConnection
 boolean update(java.lang.String sqlcmd, java.util.Vector newRecord, java.util.Vector newColumnTypeList, java.util.Vector oldRecord, java.util.Vector oldColumnTypeList)
          Database update
 boolean updateValueWithSessionConnection(java.lang.String session, java.lang.String sqlcmd)
          Invoke the connection to update value
 boolean updateValueWithSessionConnection(java.lang.String session, java.lang.String sqlcmd, java.lang.Object[] args)
           
 boolean updateValueWithSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session, java.lang.String sqlcmd)
           
 boolean updateValueWithSessionConnection(java.lang.String ip, java.lang.String port, java.lang.String session, java.lang.String sqlcmd, java.lang.Object[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBServiceImpl

public DBServiceImpl()
Method Detail

setRmiServer

public void setRmiServer(RMIServer rmiServer)

SQLloadValue

public java.util.List SQLloadValue(java.lang.String sql)
Description copied from interface: DBService
The method is used to load value from database (the RTRepository)

Specified by:
SQLloadValue in interface DBService
Parameters:
sql - the input SQL data string
Returns:
the value mapping to the SQL syntax

SQLinsertValue

public boolean SQLinsertValue(java.lang.String sql)
Description copied from interface: DBService
The method is used to insert value to database (the RTRepository)

Specified by:
SQLinsertValue in interface DBService
Parameters:
sql - the input SQL data string
Returns:
true if the insertion is successful; false otherwise.

SQLupdateValue

public boolean SQLupdateValue(java.lang.String sql)
Description copied from interface: DBService
The method is used to update value to database (the RTRepository)

Specified by:
SQLupdateValue in interface DBService
Parameters:
sql - the input SQL data string
Returns:
true if the update is successful; false otherwise.

batchSQLupdateValue

public int[] batchSQLupdateValue(java.lang.String[] sql)
Specified by:
batchSQLupdateValue in interface DBService

batchSQLupdateValue

public int[] batchSQLupdateValue(java.lang.String sql,
                                 org.springframework.jdbc.core.BatchPreparedStatementSetter bpss)
Specified by:
batchSQLupdateValue in interface DBService

SQLdeleteValue

public boolean SQLdeleteValue(java.lang.String sql)
Description copied from interface: DBService
The method is used to delete value from database (the RTRepository)

Specified by:
SQLdeleteValue in interface DBService
Parameters:
sql - the input SQL data string
Returns:
true if the deletion is successful; false otherwise.

SQLloadValue

public java.util.List SQLloadValue(java.lang.String sql,
                                   java.lang.Object[] args)
Specified by:
SQLloadValue in interface DBService

SQLinsertValue

public boolean SQLinsertValue(java.lang.String sql,
                              java.lang.Object[] args)
Specified by:
SQLinsertValue in interface DBService

SQLupdateValue

public boolean SQLupdateValue(java.lang.String sql,
                              java.lang.Object[] args)
Specified by:
SQLupdateValue in interface DBService

SQLdeleteValue

public boolean SQLdeleteValue(java.lang.String sql,
                              java.lang.Object[] args)
Specified by:
SQLdeleteValue in interface DBService

ArtSQLloadValue

public java.util.List ArtSQLloadValue(java.lang.String sql)
Description copied from interface: DBService
Database query for artifact data

Specified by:
ArtSQLloadValue in interface DBService

query

public java.util.HashMap query(java.lang.String sqlcmd)
Description copied from interface: DBService
Database query

Specified by:
query in interface DBService

query

public java.util.HashMap query(java.lang.String sqlcmd,
                               int top)
Description copied from interface: DBService
Database query, specify the result number

Specified by:
query in interface DBService

query1

public java.util.HashMap query1(java.lang.String sqlcmd)
Description copied from interface: DBService
Database query

Specified by:
query1 in interface DBService

insert

public boolean insert(java.lang.String sqlcmd,
                      java.util.Vector record,
                      java.util.Vector columnTypeList)
Description copied from interface: DBService
Database insert

Specified by:
insert in interface DBService
Returns:
true if the insert is successful; false otherwise.

delete

public boolean delete(java.lang.String sqlcmd)
Description copied from interface: DBService
Database delete

Specified by:
delete in interface DBService
Returns:
true if the delete is successful; false otherwise.

delete

public boolean delete(java.lang.String sqlcmd,
                      java.util.Vector record,
                      java.util.Vector columnTypeList)
Description copied from interface: DBService
Database delete

Specified by:
delete in interface DBService
Returns:
true if the delete is successful; false otherwise.

update

public boolean update(java.lang.String sqlcmd,
                      java.util.Vector newRecord,
                      java.util.Vector newColumnTypeList,
                      java.util.Vector oldRecord,
                      java.util.Vector oldColumnTypeList)
Description copied from interface: DBService
Database update

Specified by:
update in interface DBService
Returns:
true if the update is successful; false otherwise.

addSessionConnectionURL

public void addSessionConnectionURL(int seq,
                                    int type,
                                    java.lang.String dburl,
                                    java.lang.String username,
                                    java.lang.String password)
Description copied from interface: DBService
Add a db URL to db configuration, and specify its sequence number in it. System will generate the db name automatically.

Specified by:
addSessionConnectionURL in interface DBService
Parameters:
seq - the given DB sequence
type - the given DB Type
dburl - the given DB URL
username - the given Username
password - the given Passowrd

addSessionConnectionURL

public void addSessionConnectionURL(int seq,
                                    int type,
                                    java.lang.String name,
                                    java.lang.String dburl,
                                    java.lang.String username,
                                    java.lang.String password)
Description copied from interface: DBService
Add a db URL to db configuration, and specify its sequence number in it

Specified by:
addSessionConnectionURL in interface DBService
Parameters:
seq - the given DB sequence
type - the given DB Type
name - the given DB Name
dburl - the given DB URL
username - the given Username
password - the given Passowrd

addSessionConnectionURL

public void addSessionConnectionURL(int seq,
                                    int type,
                                    java.lang.String name,
                                    java.lang.String dburl,
                                    java.lang.String username,
                                    java.lang.String password,
                                    int minConnCount,
                                    int maxConnCount)
Description copied from interface: DBService
Add a db URL to db configuration, and specify its sequence number in it

Specified by:
addSessionConnectionURL in interface DBService
Parameters:
seq - the given DB sequence
type - the given DB Type
name - the given DB Name
dburl - the given DB URL
username - the given Username
password - the given Passowrd
minConnCount - the given Minimum Connection Number in pool.
maxConnCount - the given Maximum Connection Number in pool.

addSessionConnectionURL

public void addSessionConnectionURL(int seq,
                                    int type,
                                    java.lang.String name,
                                    java.lang.String dburl,
                                    java.lang.String username,
                                    java.lang.String password,
                                    int minConnCount,
                                    int maxConnCount,
                                    boolean isSession3X)
Description copied from interface: DBService
Add a db URL to db configuration, and specify its sequence number in it

Specified by:
addSessionConnectionURL in interface DBService
Parameters:
seq - the given DB sequence
type - the given DB Type
name - the given DB Name
dburl - the given DB URL
username - the given Username
password - the given Passowrd
minConnCount - the given Minimum Connection Number in pool.
maxConnCount - the given Maximum Connection Number in pool.
isSession3X - the given isSession3X

addNewSessionConnectionURL

public int addNewSessionConnectionURL(int type,
                                      java.lang.String name,
                                      java.lang.String dburl,
                                      java.lang.String username,
                                      java.lang.String password)
Description copied from interface: DBService
Add a new db URL to db configuration, and return its sequence number

Specified by:
addNewSessionConnectionURL in interface DBService
Parameters:
type - the given DB Type
name - the given DB Name
dburl - the given DB URL
username - the given Username
password - the given Passowrd
Returns:
sequence number in configuration.

addNewSessionConnectionURL

public int addNewSessionConnectionURL(int type,
                                      java.lang.String name,
                                      java.lang.String dburl,
                                      java.lang.String username,
                                      java.lang.String password,
                                      int minConnCount,
                                      int maxConnCount)
Description copied from interface: DBService
Add a new db URL to db configuration, and return its sequence number

Specified by:
addNewSessionConnectionURL in interface DBService
Parameters:
type - the given DB Type
name - the given DB Name
dburl - the given DB URL
username - the given Username
password - the given Passowrd
minConnCount - the given Minimum Connection Number in pool.
maxConnCount - the given Maximum Connection Number in pool.
Returns:
sequence number in configuration.

addNewSessionConnectionURL

public int addNewSessionConnectionURL(int type,
                                      java.lang.String name,
                                      java.lang.String dburl,
                                      java.lang.String username,
                                      java.lang.String password,
                                      int minConnCount,
                                      int maxConnCount,
                                      boolean isSession3X)
Description copied from interface: DBService
Add a new db URL to db configuration, and return its sequence number

Specified by:
addNewSessionConnectionURL in interface DBService
Parameters:
type - the given DB Type
name - the given DB Name
dburl - the given DB URL
username - the given Username
password - the given Passowrd
minConnCount - the given Minimum Connection Number in pool.
maxConnCount - the given Maximum Connection Number in pool.
isSession3X - the given isSession3X
Returns:
sequence number in configuration.

deleteSessionConnectionURL

public java.util.HashMap deleteSessionConnectionURL(java.lang.String name)
Description copied from interface: DBService
Remove a db URL from db configuration by given name, return the configuration which has been deleted

Specified by:
deleteSessionConnectionURL in interface DBService
Parameters:
name - the given DB Name
Returns:
SessionConnection info.

getSessionConnectionURLList

public java.util.Vector getSessionConnectionURLList()
Description copied from interface: DBService
Get the db configuration info list

Specified by:
getSessionConnectionURLList in interface DBService
Returns:
all SessionConnection info list.

getSessionConnectionURL

public java.util.HashMap getSessionConnectionURL(int sequence)
Description copied from interface: DBService
Get the db configuration info with the specific sequence number

Specified by:
getSessionConnectionURL in interface DBService
Parameters:
sequence - the given DB sequence
Returns:
SessionConnection info.

getSessionConnectionURL

public java.util.HashMap getSessionConnectionURL(java.lang.String name)
Description copied from interface: DBService
Get the db configuration info with the specific name

Specified by:
getSessionConnectionURL in interface DBService
Parameters:
name - the given DB Name
Returns:
SessionConnection info.

createSessionConnection

public SessionConnection createSessionConnection(int sequence)
Description copied from interface: DBService
Create a SessionConnection

Specified by:
createSessionConnection in interface DBService
Parameters:
sequence - the given DB sequence
Returns:
SessionConnection

createSessionConnection

public SessionConnection createSessionConnection(java.lang.String name)
Description copied from interface: DBService
Create a SessionConnection

Specified by:
createSessionConnection in interface DBService
Parameters:
name - the given DB Name
Returns:
SessionConnection

closeSessionConnection

public void closeSessionConnection(java.lang.String session)
Description copied from interface: DBService
Close a SessionConnection object

Specified by:
closeSessionConnection in interface DBService
Parameters:
session - the given Session Key

loadValueWithSessionConnection

public java.util.Vector loadValueWithSessionConnection(java.lang.String session,
                                                       java.lang.String sqlcmd)
Description copied from interface: DBService
Invoke the connection to load value

Specified by:
loadValueWithSessionConnection in interface DBService
Parameters:
session - the given Session Key
sqlcmd - the given SQL statement
Returns:
SessionConnection key.
See Also:
ResultTable

loadValueWithSessionConnection

public java.util.Vector loadValueWithSessionConnection(java.lang.String session,
                                                       java.lang.String sqlcmd,
                                                       java.lang.Object[] args)
Specified by:
loadValueWithSessionConnection in interface DBService

updateValueWithSessionConnection

public boolean updateValueWithSessionConnection(java.lang.String session,
                                                java.lang.String sqlcmd)
                                         throws java.sql.SQLException
Description copied from interface: DBService
Invoke the connection to update value

Specified by:
updateValueWithSessionConnection in interface DBService
Parameters:
session - the given Session Key
sqlcmd - the given SQL statement
Returns:
true if the update is successful; false otherwise.
Throws:
java.sql.SQLException

updateValueWithSessionConnection

public boolean updateValueWithSessionConnection(java.lang.String session,
                                                java.lang.String sqlcmd,
                                                java.lang.Object[] args)
                                         throws java.sql.SQLException
Specified by:
updateValueWithSessionConnection in interface DBService
Throws:
java.sql.SQLException

commitSessionConnection

public void commitSessionConnection(java.lang.String session)
                             throws java.sql.SQLException
Description copied from interface: DBService
Make commit on the connection

Specified by:
commitSessionConnection in interface DBService
Parameters:
session - the given Session Key
Throws:
java.sql.SQLException

rollbackSessionConnection

public void rollbackSessionConnection(java.lang.String session)
Description copied from interface: DBService
Make rollback on the connection

Specified by:
rollbackSessionConnection in interface DBService
Parameters:
session - the given Session Key

testSessionConnection

public boolean testSessionConnection(int sequence)
Description copied from interface: DBService
Test a SessionConnection

Specified by:
testSessionConnection in interface DBService
Parameters:
sequence - the given DB sequence
Returns:
true if testing is successful.

testSessionConnection

public boolean testSessionConnection(java.lang.String name)
Description copied from interface: DBService
Test a SessionConnection

Specified by:
testSessionConnection in interface DBService
Parameters:
name - the given DB Name
Returns:
true if testing is successful.

closeAllSessionConnection

public void closeAllSessionConnection()
Description copied from interface: DBService
Close a SessionConnection object

Specified by:
closeAllSessionConnection in interface DBService

closeOpenedSessionConnection

public void closeOpenedSessionConnection()
Description copied from interface: DBService
Close all SessionConnection object opened by current thread

Specified by:
closeOpenedSessionConnection in interface DBService

setSessionConnectionManager

public void setSessionConnectionManager(com.flowring.manager.SessionConnectionManager sessionConnectionManager)

closeSessionConnection

public void closeSessionConnection(java.lang.String ip,
                                   java.lang.String port,
                                   java.lang.String session)
Specified by:
closeSessionConnection in interface DBService

loadValueWithSessionConnection

public java.util.Vector loadValueWithSessionConnection(java.lang.String ip,
                                                       java.lang.String port,
                                                       java.lang.String session,
                                                       java.lang.String sqlcmd)
Specified by:
loadValueWithSessionConnection in interface DBService

loadValueWithSessionConnection

public java.util.Vector loadValueWithSessionConnection(java.lang.String ip,
                                                       java.lang.String port,
                                                       java.lang.String session,
                                                       java.lang.String sqlcmd,
                                                       java.lang.Object[] args)
Specified by:
loadValueWithSessionConnection in interface DBService

updateValueWithSessionConnection

public boolean updateValueWithSessionConnection(java.lang.String ip,
                                                java.lang.String port,
                                                java.lang.String session,
                                                java.lang.String sqlcmd)
                                         throws java.sql.SQLException
Specified by:
updateValueWithSessionConnection in interface DBService
Throws:
java.sql.SQLException

updateValueWithSessionConnection

public boolean updateValueWithSessionConnection(java.lang.String ip,
                                                java.lang.String port,
                                                java.lang.String session,
                                                java.lang.String sqlcmd,
                                                java.lang.Object[] args)
                                         throws java.sql.SQLException
Specified by:
updateValueWithSessionConnection in interface DBService
Throws:
java.sql.SQLException

commitSessionConnection

public void commitSessionConnection(java.lang.String ip,
                                    java.lang.String port,
                                    java.lang.String session)
                             throws java.sql.SQLException
Specified by:
commitSessionConnection in interface DBService
Throws:
java.sql.SQLException

rollbackSessionConnection

public void rollbackSessionConnection(java.lang.String ip,
                                      java.lang.String port,
                                      java.lang.String session)
Specified by:
rollbackSessionConnection in interface DBService

getSessionConnectionURL

public java.util.HashMap getSessionConnectionURL(java.lang.String ip,
                                                 java.lang.String port,
                                                 java.lang.String name)
Specified by:
getSessionConnectionURL in interface DBService

getSessionConnectionURL

public java.util.HashMap getSessionConnectionURL(java.lang.String ip,
                                                 java.lang.String port,
                                                 int sequence)
Specified by:
getSessionConnectionURL in interface DBService

isConnectFailure

public boolean isConnectFailure(java.lang.Throwable ex)