java.lang.Object
com.inductiveautomation.ignition.gateway.util.DBUtilities

public class DBUtilities extends Object
Static utility functions pertaining to the database.
  • 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

      public static void close(Connection conn, Statement stmt)
      Silently close the given connection and statement.
    • rollback

      public static void rollback(Connection conn)
    • close

      public static void close(Connection conn)
    • close

      public static void close(Statement stmt)
    • close

      public static void close(ResultSet rs)
    • isDataManipulationQuery

      public static boolean isDataManipulationQuery(String query)
      Returns false if query is SELECT, otherwise true.
    • getJdbcType

      public static int getJdbcType(DataType type)
    • getTypeForJDBC

      public static DataType getTypeForJDBC(int jdbcType)