Class DBUtilities
java.lang.Object
com.inductiveautomation.ignition.gateway.util.DBUtilities
Static utility functions pertaining to the database.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(Connection conn) static voidclose(Connection conn, Statement stmt) Silently close the given connection and statement.static voidstatic voidstatic intgetJdbcType(DataType type) static ObjectgetParameterValue(CallableStatement stmt, int index, int dbType) static ObjectgetParameterValue(CallableStatement stmt, 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(String query) Returns false if query is SELECT, otherwise true.static voidrollback(Connection conn)
-
Constructor Details
-
DBUtilities
public DBUtilities()
-
-
Method Details
-
getParameterValue
public static Object getParameterValue(CallableStatement stmt, String paramName, int dbType) throws SQLException This class is necessary because some db connectors don't correctly support CallableStatement.getObject(string) [MYSQL is one, which always returns byte[2]]- Throws:
SQLException
-
getParameterValue
public static Object getParameterValue(CallableStatement stmt, int index, int dbType) throws SQLException - Throws:
SQLException
-
close
Silently close the given connection and statement. -
rollback
-
close
-
close
-
close
-
isDataManipulationQuery
Returns false if query is SELECT, otherwise true. -
getJdbcType
-
getTypeForJDBC
-