Class DBUtilities
- java.lang.Object
- 
- com.inductiveautomation.ignition.gateway.util.DBUtilities
 
- 
 public class DBUtilities extends java.lang.ObjectStatic utility functions pertaining to the database.
- 
- 
Constructor SummaryConstructors Constructor Description DBUtilities()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose(java.sql.Connection conn)static voidclose(java.sql.Connection conn, java.sql.Statement stmt)Silently close the given connection and statement.static voidclose(java.sql.ResultSet rs)static voidclose(java.sql.Statement stmt)static intgetJdbcType(DataType type)static java.lang.ObjectgetParameterValue(java.sql.CallableStatement stmt, int index, int dbType)static java.lang.ObjectgetParameterValue(java.sql.CallableStatement stmt, java.lang.String paramName, int dbType)This class is necessary because some db connectors don't correctly support CallableStatement.getObject(string) [MYSQL is one, which always returns byte[2]]static DataTypegetTypeForJDBC(int jdbcType)static booleanisDataManipulationQuery(java.lang.String query)Returns false if query is SELECT, otherwise true.static voidrollback(java.sql.Connection conn)
 
- 
- 
- 
Method Detail- 
getParameterValuepublic static java.lang.Object getParameterValue(java.sql.CallableStatement stmt, java.lang.String paramName, int dbType) throws java.sql.SQLExceptionThis class is necessary because some db connectors don't correctly support CallableStatement.getObject(string) [MYSQL is one, which always returns byte[2]]- Throws:
- java.sql.SQLException
 
 - 
getParameterValuepublic static java.lang.Object getParameterValue(java.sql.CallableStatement stmt, int index, int dbType) throws java.sql.SQLException- Throws:
- java.sql.SQLException
 
 - 
closepublic static void close(java.sql.Connection conn, java.sql.Statement stmt)Silently close the given connection and statement.
 - 
rollbackpublic static void rollback(java.sql.Connection conn) 
 - 
closepublic static void close(java.sql.Connection conn) 
 - 
closepublic static void close(java.sql.Statement stmt) 
 - 
closepublic static void close(java.sql.ResultSet rs) 
 - 
isDataManipulationQuerypublic static boolean isDataManipulationQuery(java.lang.String query) Returns false if query is SELECT, otherwise true.
 - 
getJdbcTypepublic static int getJdbcType(DataType type) 
 - 
getTypeForJDBCpublic static DataType getTypeForJDBC(int jdbcType) 
 
- 
 
-