com.github.drinkjava2.jdbpro
Interface NormalJdbcTool


public interface NormalJdbcTool

Interface of Normal JDBC methods, this interface is used for other projects to eliminate jar dependency, other projects need copy this interface into there source code folder but always use name "com.github.drinkjava2.jdbpro.NormalJdbcTool"

Since:
1.7.0.1
Author:
Yong Zhu

Method Summary
 int nExecute(String sql, Object... params)
          Execute an statement, including a stored procedure call, which does not return any result sets.
<T> T
nQueryForObject(String sql, Object... params)
          Query for an Object, only return the first row and first column's value if more than one column or more than 1 rows returned, a null object may return if no result found
 int nUpdate(String sql, Object... params)
          Executes the given INSERT, UPDATE, or DELETE SQL statement.
 

Method Detail

nQueryForObject

<T> T nQueryForObject(String sql,
                      Object... params)
Query for an Object, only return the first row and first column's value if more than one column or more than 1 rows returned, a null object may return if no result found

Parameters:
sql -
params -
Returns:
An Object or null, Object type determined by SQL content

nUpdate

int nUpdate(String sql,
            Object... params)
Executes the given INSERT, UPDATE, or DELETE SQL statement.

Parameters:
sql - the SQL
params - the parameters if have
Returns:
The number of rows updated.

nExecute

int nExecute(String sql,
             Object... params)
Execute an statement, including a stored procedure call, which does not return any result sets. Any parameters which are instances of org.apache.commons.dbutils.OutParameter will be registered as OUT parameters. Transaction mode is determined by connectionManager property.

Use this method when invoking a stored procedure with OUT parameters that does not return any result sets. If you are not invoking a stored procedure, or the stored procedure has no OUT parameters, consider using #Update(java.lang.String...) . If the stored procedure returns result sets, use #iExecute(org.apache.commons.dbutils.ResultSetHandler, java.lang.String...) .

Parameters:
sql - the SQL
Returns:
The number of rows updated.


Copyright © 2018. All rights reserved.