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 void
close
(Connection conn) static void
close
(Connection conn, Statement stmt) Silently close the given connection and statement.static void
static void
static int
getJdbcType
(DataType type) static Object
getParameterValue
(CallableStatement stmt, int index, int dbType) static Object
getParameterValue
(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 DataType
getTypeForJDBC
(int jdbcType) static boolean
isDataManipulationQuery
(String query) Returns false if query is SELECT, otherwise true.static void
rollback
(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
-