public class BySqlStatic extends Object
Modifier and Type | Method and Description |
---|---|
static void |
attachParams(PreparedStatement statement,
Object params)
Attach params for a prepared statement.
|
static void |
attachParams(PreparedStatement statement,
Object params,
Object types)
Attach params for a prepared statement.
|
int |
executeSql(String sql)
execute some sql
|
int |
executeSql(String sql,
List<Object> params)
execute some sql
|
<T> List<T> |
listSelect(Class<T> returnClassType,
String sql,
List<Object> params)
select one object from sql (one row, one col
|
<T> T |
select(Class<T> returnClassType,
String sql)
select one object from sql (one row, one col
|
<T> T |
select(Class<T> returnClassType,
String sql,
List<Object> params)
select one object from sql (one row, one col
|
public int executeSql(String sql)
sql
- can be insert, update, delete, or ddlpublic int executeSql(String sql, List<Object> params)
sql
- can be insert, update, delete, or ddlparams
- prepared statement paramspublic <T> T select(Class<T> returnClassType, String sql)
T
- the typereturnClassType
- type to be returned (currnetly supports string and intsql
- can be insert, update, delete, or ddlpublic <T> T select(Class<T> returnClassType, String sql, List<Object> params)
T
- the typereturnClassType
- type to be returned (currnetly supports string and intsql
- can be insert, update, delete, or ddlparams
- prepared statement paramspublic <T> List<T> listSelect(Class<T> returnClassType, String sql, List<Object> params)
T
- the typereturnClassType
- type to be returned (currnetly supports string and intsql
- can be insert, update, delete, or ddlparams
- prepared statement paramspublic static void attachParams(PreparedStatement statement, Object params) throws org.hibernate.HibernateException, SQLException
statement
- params
- either null, Object, Object[], or List of Objectsorg.hibernate.HibernateException
SQLException
public static void attachParams(PreparedStatement statement, Object params, Object types) throws org.hibernate.HibernateException, SQLException
statement
- params
- either null, Object, Object[], or List of Objectstypes
- either null, Type, Type[], or List of Objectsorg.hibernate.HibernateException
SQLException
Copyright © 2016 Internet2. All rights reserved.