Class DAOUtil

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBatch()
      Adds a set of parameters to this PreparedStatement object's batch of commands.
      void addBatch​(String sql)
      Adds the given SQL command to the current list of commands for this Statement object.
      void clearParameters()
      Clears the current parameter values immediately.
      void close()
      int[] executeBatch()
      Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.
      void executeQuery()
      Executes a query
      void executeUpdate()
      Executes the update request and throws an error if the result is not 1
      void free()
      Free connection
      Array getArray​(int nIndex)
      Get an Array value
      Array getArray​(String strColumnName)
      Get an Array value
      InputStream getAsciiString​(int nIndex)
      Get an ascii value stream
      InputStream getAsciiString​(String strColumnName)
      Get an ascii value stream
      BigDecimal getBigDecimal​(int nIndex)
      Get a BigDecimal value
      BigDecimal getBigDecimal​(String strColumnName)
      Get a BigDecimal value
      InputStream getBinaryStream​(int nIndex)
      Gets a binary stream from a resultSet
      Blob getBlob​(int nIndex)
      Gets a blob from a resultset
      Blob getBlob​(String strColumnName)
      Gets a blob from a resultset
      boolean getBoolean​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a Boolean
      boolean getBoolean​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a Boolean
      byte getByte​(int nIndex)
      Gets a byte from a resultset
      byte getByte​(String strColumnName)
      Gets a byte from a resultset
      byte[] getBytes​(int nIndex)
      Gets a byte array from a resultset
      byte[] getBytes​(String strColumnName)
      Gets a byte array from a resultset
      Reader getCharacterStream​(int nIndex)
      Get a character stream value
      Reader getCharacterStream​(String strColumnName)
      Get a character stream value
      Clob getClob​(int nIndex)
      Get a Clob value
      Clob getClob​(String strColumnName)
      Get a Clob value
      Date getDate​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
      Date getDate​(int nIndex, Calendar calendar)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
      Date getDate​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
      Date getDate​(String strColumnName, Calendar calendar)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
      double getDouble​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a double
      double getDouble​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a double
      float getFloat​(int nIndex)
      Get a float value
      float getFloat​(String strColumnName)
      Get a float value
      BigDecimal getGeneratedKeyBigDecimal​(int nIndex)
      Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a BigDecimal
      byte getGeneratedKeyByte​(int nIndex)
      Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a byte
      int getGeneratedKeyInt​(int nIndex)
      Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a int
      long getGeneratedKeyLong​(int nIndex)
      Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a long
      short getGeneratedKeyShort​(int nIndex)
      Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a short
      ResultSet getGeneratedKeysResultSet()
      Get the GeneratedKeys ResultSet
      int getInt​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a int
      int getInt​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a int
      long getLong​(int nIndex)
      Gets the long value
      long getLong​(String strColumnName)
      Gets the long value
      Reader getNCharacterStream​(int nIndex)
      Get a character stream value
      Reader getNCharacterStream​(String strColumnName)
      Get a character stream value
      NClob getNClob​(int nIndex)
      Get a NClob value
      NClob getNClob​(String strColumnName)
      Get a Clob value
      String getNString​(int nIndex)
      Get a String value
      String getNString​(String strColumnName)
      Get a Stringvalue
      Object getObject​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a Object
      <T> T getObject​(int nIndex, Class<T> type)
      Gets the value of the designated column in the current row of this ResultSet object as a T
      Object getObject​(int nIndex, Map<String,​Class<?>> map)
      Gets the value of the designated column in the current row of this ResultSet object as a Object
      Object getObject​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as an Object
      <T> T getObject​(String strColumnName, Class<T> type)
      Gets the value of the designated column in the current row of this ResultSet object as an Object
      Object getObject​(String strColumnName, Map<String,​Class<?>> map)
      Gets the value of the designated column in the current row of this ResultSet object as an Object
      Ref getRef​(int nIndex)
      Get a Ref value
      Ref getRef​(String strColumnName)
      Get a Ref value
      ResultSet getResultSet()
      Get the ResultSet
      RowId getRowId​(int nIndex)
      Get a RowId value
      RowId getRowId​(String strColumnName)
      Get a RowId value
      short getShort​(int nIndex)
      Get a short value
      short getShort​(String strColumnName)
      Get a short value
      SQLXML getSQLXML​(int nIndex)
      Get a SQLXML value
      SQLXML getSQLXML​(String strColumnName)
      Get a SQLXML value
      String getString​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a string
      String getString​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a string
      Time getTime​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
      Time getTime​(int nIndex, Calendar calendar)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
      Time getTime​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
      Time getTime​(String strColumnName, Calendar calendar)
      Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
      Timestamp getTimestamp​(int nIndex)
      Gets the value of the designated column in the current row of this ResultSet object as a timestamp
      Timestamp getTimestamp​(int nIndex, Calendar calendar)
      Gets the value of the designated column in the current row of this ResultSet object as a timestamp
      Timestamp getTimestamp​(String strColumnName)
      Gets the value of the designated column in the current row of this ResultSet object as a Timestamp
      Timestamp getTimestamp​(String strColumnName, Calendar calendar)
      Gets the value of the designated column in the current row of this ResultSet object as a Timestamp
      URL getURL​(int nIndex)
      Get a URL value
      URL getURL​(String strColumnName)
      Get a URL value
      boolean isLast()
      Indicates whether the cursor is on the last row of this ResultSet object.
      boolean next()
      Moves the cursor down one row from its current position in the ResultSet.
      boolean nextGeneratedKey()
      Moves the cursor down one row from its current position in the GeneratedKeys ResultSet.
      void setArray​(int nIndex, String strTypename, Object[] elements)
      Set an Array value
      void setAsciiStream​(int nIndex, InputStream stream)
      Fills the prepared statement with an ascii value stream
      void setAsciiStream​(int nIndex, InputStream stream, int nLength)
      Fills the prepared statement with an ascii value stream
      void setAsciiStream​(int nIndex, InputStream stream, long lLength)
      Fills the prepared statement with an ascii value stream
      void setBigDecimal​(int nIndex, BigDecimal value)
      Fills the prepared Statement with a BigDecimal value
      void setBinaryStream​(int nIndex, InputStream iStream)
      Fills the prepared statement with a binary value stream
      void setBinaryStream​(int nIndex, InputStream iStream, int nBlength)
      Fills the prepared statement with a binary value stream
      void setBinaryStream​(int nIndex, InputStream iStream, long nBlength)
      Fills the prepared statement with a binary value stream
      void setBlob​(int nIndex, InputStream stream)
      Fills the prepared statement with a blob value from a stream
      void setBlob​(int nIndex, InputStream stream, long nLength)
      Fills the prepared statement with a blob value from a stream
      void setBlob​(int nIndex, Blob blob)
      Fills the prepared statement with a blob value
      void setBoolean​(int nIndex, boolean bValue)
      Fills the prepared statement with a Boolean value
      void setByte​(int nIndex, byte bValue)
      Fills the prepared statement with a byte value
      void setBytes​(int nIndex, byte[] tbValue)
      Fills the prepared statement with a byte array value
      void setCharacterStream​(int nIndex, Reader stream)
      Fills the prepared statement with a character stream
      void setCharacterStream​(int nIndex, Reader stream, int nLength)
      Fills the prepared statement with a character stream
      void setCharacterStream​(int nIndex, Reader stream, long nLength)
      Fills the prepared statement with a character stream
      void setClob​(int nIndex, Reader stream)
      Fills the prepared statement with a Clob stream
      void setClob​(int nIndex, Reader stream, long nLength)
      Fills the prepared statement with a Clob stream
      void setClob​(int nIndex, Clob clob)
      Fills the prepared statement with a Clob
      void setClob​(int nIndex, NClob clob)
      Fills the prepared statement with a NClob
      void setDate​(int nIndex, Date date)
      Fills the prepared statement with a date value
      void setDate​(int nIndex, Date date, Calendar calendar)
      Fills the prepared statement with a date value
      void setDouble​(int nIndex, double dValue)
      Fills the prepared statement with a double value
      void setDoubleNull​(int nIndex)
      Sets null value for a "double" column
      void setFloat​(int nIndex, float fValue)
      Fills the prepared statement with a float value
      void setInt​(int nIndex, int nValue)
      Fills the prepared statement with a int value
      void setIntNull​(int nIndex)
      Fills the prepared statement with a int null value
      void setLong​(int nIndex, long lValue)
      Sets a long value
      void setLongNull​(int nIndex)
      Sets null value for a "long" column
      void setNCharacterStream​(int nIndex, Reader stream)
      Fills the prepared statement with a character stream value
      void setNCharacterStream​(int nIndex, Reader stream, long nLength)
      Fills the prepared statement with a character stream value
      void setNClob​(int nIndex, Reader stream)
      Fills the prepared statement with a NClob stream
      void setNClob​(int nIndex, Reader stream, long nLength)
      Fills the prepared statement with a NClob stream
      void setNString​(int nIndex, String strValue)
      Fills the prepared statement with a String value
      void setNull​(int nIndex, int nType)
      Fills the prepared statement with a null value
      void setNull​(int nIndex, int nType, String strTypeName)
      Fills the prepared statement with a null value
      void setObject​(int nIndex, Object value)
      Fills the prepared statement with an object value
      void setObject​(int nIndex, Object value, int nType)
      Fills the prepared statement with an object value
      void setObject​(int nIndex, Object value, int nType, int nScaleOrLength)
      Fills the prepared statement with an object value
      void setRef​(int nIndex, Ref ref)
      Fills the prepared statement with an Ref value
      void setRowId​(int nIndex, RowId rowId)
      Fills the prepared statement with a RowId value
      void setShort​(int nIndex, short shortValue)
      Fills the prepared statement with a short value
      void setSQLXML​(int nIndex, SQLXML value)
      Fills the prepared statement with a SQLXML value
      void setString​(int nIndex, String strValue)
      Fills the prepared statement with a string value
      void setTime​(int nIndex, Time time)
      Fills the prepared statement with a time value
      void setTime​(int nIndex, Time time, Calendar calendar)
      Fills the prepared statement with a time value
      void setTimestamp​(int nIndex, Timestamp ts)
      Fills the prepared statement with a timestamp value
      void setTimestamp​(int nIndex, Timestamp ts, Calendar calendar)
      Fills the prepared statement with a timestamp value
      void setURL​(int nIndex, URL url)
      Fills the prepared statement with a URL value
    • Constructor Detail

      • DAOUtil

        public DAOUtil​(String sql)
        Creates a new DAOUtil object.
        Parameters:
        sql - Sql Query for prepared Statement
      • DAOUtil

        public DAOUtil​(String sql,
                       boolean logQueries)
        Creates a new DAOUtil object.
        Parameters:
        sql - Sql Query for prepared Statement
      • DAOUtil

        public DAOUtil​(String strSQL,
                       Plugin plugin)
        Creates a new DAOUtil object.
        Parameters:
        strSQL - sql query for prepared Statement
        plugin - The plugin using this database access
      • DAOUtil

        public DAOUtil​(String strSQL,
                       Plugin plugin,
                       boolean bLogQueries)
        Creates a new DAOUtil object.
        Parameters:
        strSQL - sql query for prepared Statement
        plugin - The plugin using this database access
      • DAOUtil

        public DAOUtil​(String sql,
                       Integer autoGeneratedKeys)
        Creates a new DAOUtil object.
        Parameters:
        sql - Sql Query for prepared Statement
        autoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; For example one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS. See PreparedStatement#prepareStatement(String, int)
        Since:
        6.0.0
      • DAOUtil

        public DAOUtil​(String strSQL,
                       Integer autoGeneratedKeys,
                       Plugin plugin)
        Creates a new DAOUtil object.
        Parameters:
        strSQL - sql query for prepared Statement
        autoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; For example one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS. See PreparedStatement#prepareStatement(String, int)
        plugin - The plugin using this database access
        Since:
        6.0.0
      • DAOUtil

        public DAOUtil​(String strSQL,
                       Integer autoGeneratedKeys,
                       Plugin plugin,
                       boolean bLogQueries)
        Creates a new DAOUtil object.
        Parameters:
        bLogQueries -
        strSQL - sql query for prepared Statement
        autoGeneratedKeys - a flag indicating whether auto-generated keys should be returned; For example one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS. See PreparedStatement#prepareStatement(String, int)
        plugin - The plugin using this database access
        Since:
        6.0.0
    • Method Detail

      • executeUpdate

        public void executeUpdate()
        Executes the update request and throws an error if the result is not 1
      • executeQuery

        public void executeQuery()
        Executes a query
      • free

        public final void free()
        Free connection
      • isLast

        public boolean isLast()
        Indicates whether the cursor is on the last row of this ResultSet object.
        Returns:
        true if the cursor is on the last row; false otherwise
      • setDate

        public void setDate​(int nIndex,
                            Date date)
        Fills the prepared statement with a date value
        Parameters:
        nIndex - parameter index
        date - date value
      • setTime

        public void setTime​(int nIndex,
                            Time time)
        Fills the prepared statement with a time value
        Parameters:
        nIndex - parameter index
        time - time value
      • setBinaryStream

        public void setBinaryStream​(int nIndex,
                                    InputStream iStream,
                                    int nBlength)
        Fills the prepared statement with a binary value stream
        Parameters:
        nIndex - parameter index
        iStream - the java input stream which contains the binary parameter value
        nBlength - the number of bytes in the stream
      • setBinaryStream

        public void setBinaryStream​(int nIndex,
                                    InputStream iStream,
                                    long nBlength)
        Fills the prepared statement with a binary value stream
        Parameters:
        nIndex - parameter index
        iStream - the java input stream which contains the binary parameter value
        nBlength - the number of bytes in the stream
        Since:
        5.1.1
        See Also:
        PreparedStatement.setBinaryStream(int, InputStream, long)
      • setBinaryStream

        public void setBinaryStream​(int nIndex,
                                    InputStream iStream)
        Fills the prepared statement with a binary value stream
        Parameters:
        nIndex - parameter index
        iStream - the java input stream which contains the binary parameter value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setBinaryStream(int, InputStream)
      • getBinaryStream

        public InputStream getBinaryStream​(int nIndex)
        Gets a binary stream from a resultSet
        Parameters:
        nIndex - column index
        Returns:
        InputStream instance
      • getBlob

        public Blob getBlob​(int nIndex)
        Gets a blob from a resultset
        Parameters:
        nIndex - column index
        Returns:
        Blob instance
      • getBlob

        public Blob getBlob​(String strColumnName)
        Gets a blob from a resultset
        Parameters:
        strColumnName - column name
        Returns:
        Blob instance
      • setBlob

        public void setBlob​(int nIndex,
                            InputStream stream,
                            long nLength)
        Fills the prepared statement with a blob value from a stream
        Parameters:
        nIndex - the index
        stream - the value
        nLength - the number of bytes to read
        Since:
        5.1.1
        See Also:
        PreparedStatement.setBlob(int, InputStream, long)
      • getBytes

        public byte[] getBytes​(int nIndex)
        Gets a byte array from a resultset
        Parameters:
        nIndex - column index
        Returns:
        byte[] instance
      • getBytes

        public byte[] getBytes​(String strColumnName)
        Gets a byte array from a resultset
        Parameters:
        strColumnName - column name
        Returns:
        byte[] instance
      • getByte

        public byte getByte​(int nIndex)
        Gets a byte from a resultset
        Parameters:
        nIndex - column index
        Returns:
        byte instance
        Since:
        5.1.1
        See Also:
        ResultSet.getByte(int)
      • getByte

        public byte getByte​(String strColumnName)
        Gets a byte from a resultset
        Parameters:
        strColumnName - column name
        Returns:
        byte instance
        Since:
        5.1.1
        See Also:
        ResultSet.getByte(int)
      • setInt

        public void setInt​(int nIndex,
                           int nValue)
        Fills the prepared statement with a int value
        Parameters:
        nIndex - parameter index in the prepared statement
        nValue - int value
      • setBoolean

        public void setBoolean​(int nIndex,
                               boolean bValue)
        Fills the prepared statement with a Boolean value
        Parameters:
        nIndex - parameter index in the prepared statement
        bValue - Boolean value
      • setByte

        public void setByte​(int nIndex,
                            byte bValue)
        Fills the prepared statement with a byte value
        Parameters:
        nIndex - parameter index in the prepared statement
        bValue - byte value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setByte(int, byte)
      • setBytes

        public void setBytes​(int nIndex,
                             byte[] tbValue)
        Fills the prepared statement with a byte array value
        Parameters:
        nIndex - parameter index in the prepared statement
        tbValue - byte array value
      • setString

        public void setString​(int nIndex,
                              String strValue)
        Fills the prepared statement with a string value
        Parameters:
        nIndex - parameter index in the prepared statement
        strValue - string value
      • setTimestamp

        public void setTimestamp​(int nIndex,
                                 Timestamp ts)
        Fills the prepared statement with a timestamp value
        Parameters:
        nIndex - parameter index in the prepared statement
        ts - timestamp value
      • setDouble

        public void setDouble​(int nIndex,
                              double dValue)
        Fills the prepared statement with a double value
        Parameters:
        nIndex - parameter index in the prepared statement
        dValue - The value
      • setDoubleNull

        public void setDoubleNull​(int nIndex)
        Sets null value for a "double" column
        Parameters:
        nIndex - the index
      • getDate

        public Date getDate​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
      • getDate

        public Date getDate​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
        Parameters:
        strColumnName - name of the column, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
      • getDate

        public Date getDate​(int nIndex,
                            Calendar calendar)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        calendar - the calendar
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
        Since:
        5.1.1
        See Also:
        ResultSet.getDate(int, Calendar)
      • getDate

        public Date getDate​(String strColumnName,
                            Calendar calendar)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language.
        Parameters:
        strColumnName - name of the column, ...
        calendar - the calendar
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
        Since:
        5.1.1
        See Also:
        ResultSet.getDate(String, Calendar)
      • getTime

        public Time getTime​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
      • getTime

        public Time getTime​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
        Parameters:
        strColumnName - name of the column, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
      • getTime

        public Time getTime​(int nIndex,
                            Calendar calendar)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        calendar - the calendar
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
        Since:
        5.1.1
        See Also:
        ResultSet.getTime(int, Calendar)
      • getTime

        public Time getTime​(String strColumnName,
                            Calendar calendar)
        Gets the value of the designated column in the current row of this ResultSet object as a java.sql.Time object in the Java programming language.
        Parameters:
        strColumnName - name of the column, ...
        calendar - the calendar
        Returns:
        the column value; if the value is SQL NULL, the value returned is null
        Since:
        5.1.1
        See Also:
        ResultSet.getTime(String, Calendar)
      • getInt

        public int getInt​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a int
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
      • getInt

        public int getInt​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a int
        Parameters:
        strColumnName - column name
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
      • getBoolean

        public boolean getBoolean​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a Boolean
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is FALSE
      • getBoolean

        public boolean getBoolean​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a Boolean
        Parameters:
        strColumnName - column name
        Returns:
        the column value; if the value is SQL NULL, the value returned is FALSE
      • getString

        public String getString​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a string
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getString

        public String getString​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a string
        Parameters:
        strColumnName - column name
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getTimestamp

        public Timestamp getTimestamp​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a timestamp
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getTimestamp

        public Timestamp getTimestamp​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a Timestamp
        Parameters:
        strColumnName - column name
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getTimestamp

        public Timestamp getTimestamp​(int nIndex,
                                      Calendar calendar)
        Gets the value of the designated column in the current row of this ResultSet object as a timestamp
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        calendar - the calendar
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
        Since:
        5.1.1
        See Also:
        ResultSet.getTimestamp(int, Calendar)
      • getTimestamp

        public Timestamp getTimestamp​(String strColumnName,
                                      Calendar calendar)
        Gets the value of the designated column in the current row of this ResultSet object as a Timestamp
        Parameters:
        strColumnName - column name
        calendar - the calendar
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
        Since:
        5.1.1
        See Also:
        ResultSet.getTimestamp(String, Calendar)
      • getDouble

        public double getDouble​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as a double
        Parameters:
        strColumnName - column name
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getDouble

        public double getDouble​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a double
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
      • getObject

        public Object getObject​(int nIndex)
        Gets the value of the designated column in the current row of this ResultSet object as a Object
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getObject

        public <T> T getObject​(int nIndex,
                               Class<T> type)
        Gets the value of the designated column in the current row of this ResultSet object as a T
        Type Parameters:
        T - the return type
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        type - the type
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
        Since:
        5.1.1
        See Also:
        ResultSet.getObject(int, Class)
      • getObject

        public Object getObject​(int nIndex,
                                Map<String,​Class<?>> map)
        Gets the value of the designated column in the current row of this ResultSet object as a Object
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        map - the type map
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
        Since:
        5.1.1
        See Also:
        ResultSet.getObject(int, java.util.Map)
      • getResultSet

        public ResultSet getResultSet()
        Get the ResultSet
        Returns:
        the resultSet
      • getGeneratedKeysResultSet

        public ResultSet getGeneratedKeysResultSet()
        Get the GeneratedKeys ResultSet
        Returns:
        the GeneratedKeys ResultSet
        Since:
        6.0.0
      • getObject

        public Object getObject​(String strColumnName)
        Gets the value of the designated column in the current row of this ResultSet object as an Object
        Parameters:
        strColumnName - column name
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
      • getObject

        public <T> T getObject​(String strColumnName,
                               Class<T> type)
        Gets the value of the designated column in the current row of this ResultSet object as an Object
        Type Parameters:
        T - the return type
        Parameters:
        strColumnName - column name
        type - the type
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
        Since:
        5.1.1
        See Also:
        ResultSet.getObject(String, Class)
      • getObject

        public Object getObject​(String strColumnName,
                                Map<String,​Class<?>> map)
        Gets the value of the designated column in the current row of this ResultSet object as an Object
        Parameters:
        strColumnName - column name
        map - type map
        Returns:
        the column value; if the value is SQL NULL, the value returned is NULL
        Since:
        5.1.1
        See Also:
        ResultSet.getObject(String, java.util.Map)
      • next

        public boolean next()
        Moves the cursor down one row from its current position in the ResultSet.
        Returns:
        true if the new current row is valid; false if there are no more rows
      • nextGeneratedKey

        public boolean nextGeneratedKey()
        Moves the cursor down one row from its current position in the GeneratedKeys ResultSet.
        Returns:
        true if the new current row is valid; false if there are no more rows
        Since:
        6.0.0
      • getGeneratedKeyByte

        public byte getGeneratedKeyByte​(int nIndex)
        Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a byte
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
        Since:
        6.0.0
      • getGeneratedKeyShort

        public short getGeneratedKeyShort​(int nIndex)
        Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a short
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
        Since:
        6.0.0
      • getGeneratedKeyInt

        public int getGeneratedKeyInt​(int nIndex)
        Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a int
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
        Since:
        6.0.0
      • getGeneratedKeyLong

        public long getGeneratedKeyLong​(int nIndex)
        Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a long
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
        Since:
        6.0.0
      • getGeneratedKeyBigDecimal

        public BigDecimal getGeneratedKeyBigDecimal​(int nIndex)
        Gets the value of the designated column in the current row of this GeneratedKeys ResultSet object as a BigDecimal
        Parameters:
        nIndex - the first column is 1, the second is 2, ...
        Returns:
        the column value; if the value is SQL NULL, the value returned is 0
        Since:
        6.0.0
      • setIntNull

        public void setIntNull​(int nIndex)
        Fills the prepared statement with a int null value
        Parameters:
        nIndex - parameter index
      • setLongNull

        public void setLongNull​(int nIndex)
        Sets null value for a "long" column
        Parameters:
        nIndex - the index
      • setLong

        public void setLong​(int nIndex,
                            long lValue)
        Sets a long value
        Parameters:
        nIndex - the index
        lValue - the value
      • getLong

        public long getLong​(int nIndex)
        Gets the long value
        Parameters:
        nIndex - the index
        Returns:
        the long value
      • getLong

        public long getLong​(String strColumnName)
        Gets the long value
        Parameters:
        strColumnName - the column name
        Returns:
        the long value
      • getArray

        public Array getArray​(int nIndex)
        Get an Array value
        Parameters:
        nIndex - the index
        Returns:
        the array value
        Since:
        5.1.1
        See Also:
        ResultSet.getArray(int)
      • getArray

        public Array getArray​(String strColumnName)
        Get an Array value
        Parameters:
        strColumnName - the column name
        Returns:
        the array value
        Since:
        5.1.1
        See Also:
        ResultSet.getArray(String)
      • getAsciiString

        public InputStream getAsciiString​(int nIndex)
        Get an ascii value stream
        Parameters:
        nIndex - the index
        Returns:
        the ascii stream
        Since:
        5.1.1
        See Also:
        ResultSet.getAsciiStream(int)
      • getBigDecimal

        public BigDecimal getBigDecimal​(int nIndex)
        Get a BigDecimal value
        Parameters:
        nIndex - the index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getBigDecimal(int)
      • setCharacterStream

        public void setCharacterStream​(int nIndex,
                                       Reader stream,
                                       int nLength)
        Fills the prepared statement with a character stream
        Parameters:
        nIndex - the index
        stream - the stream
        nLength - the number of bytes to read
        Since:
        5.1.1
        See Also:
        PreparedStatement.setCharacterStream(int, Reader, int)
      • setCharacterStream

        public void setCharacterStream​(int nIndex,
                                       Reader stream,
                                       long nLength)
        Fills the prepared statement with a character stream
        Parameters:
        nIndex - the index
        stream - the stream
        nLength - the number of bytes to read
        Since:
        5.1.1
        See Also:
        PreparedStatement.setCharacterStream(int, Reader, long)
      • getCharacterStream

        public Reader getCharacterStream​(int nIndex)
        Get a character stream value
        Parameters:
        nIndex - the column index
        Returns:
        the stream value
        Since:
        5.1.1
        See Also:
        ResultSet.getCharacterStream(int)
      • getCharacterStream

        public Reader getCharacterStream​(String strColumnName)
        Get a character stream value
        Parameters:
        strColumnName - the column index
        Returns:
        the stream value
        Since:
        5.1.1
        See Also:
        ResultSet.getCharacterStream(String)
      • setClob

        public void setClob​(int nIndex,
                            Reader stream)
        Fills the prepared statement with a Clob stream
        Parameters:
        nIndex - the index
        stream - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setClob(int, Reader)
      • setClob

        public void setClob​(int nIndex,
                            Reader stream,
                            long nLength)
        Fills the prepared statement with a Clob stream
        Parameters:
        nIndex - the index
        stream - the value
        nLength - the number of bytes to read
        Since:
        5.1.1
        See Also:
        PreparedStatement.setClob(int, Reader, long)
      • setClob

        public void setClob​(int nIndex,
                            Clob clob)
        Fills the prepared statement with a Clob
        Parameters:
        nIndex - the index
        clob - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setClob(int, Clob)
      • getClob

        public Clob getClob​(int nIndex)
        Get a Clob value
        Parameters:
        nIndex - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getClob(int)
      • getClob

        public Clob getClob​(String strColumnName)
        Get a Clob value
        Parameters:
        strColumnName - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getClob(String)
      • setNClob

        public void setNClob​(int nIndex,
                             Reader stream)
        Fills the prepared statement with a NClob stream
        Parameters:
        nIndex - the index
        stream - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setNClob(int, Reader)
      • setNClob

        public void setNClob​(int nIndex,
                             Reader stream,
                             long nLength)
        Fills the prepared statement with a NClob stream
        Parameters:
        nIndex - the index
        stream - the value
        nLength - the number of bytes to read
        Since:
        5.1.1
        See Also:
        PreparedStatement.setNClob(int, Reader, long)
      • getNClob

        public NClob getNClob​(int nIndex)
        Get a NClob value
        Parameters:
        nIndex - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getNClob(int)
      • getNClob

        public NClob getNClob​(String strColumnName)
        Get a Clob value
        Parameters:
        strColumnName - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getClob(String)
      • setFloat

        public void setFloat​(int nIndex,
                             float fValue)
        Fills the prepared statement with a float value
        Parameters:
        nIndex - the index
        fValue - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setFloat(int, float)
      • getFloat

        public float getFloat​(String strColumnName)
        Get a float value
        Parameters:
        strColumnName - the column name
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getFloat(String)
      • getFloat

        public float getFloat​(int nIndex)
        Get a float value
        Parameters:
        nIndex - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getFloat(int)
      • setNCharacterStream

        public void setNCharacterStream​(int nIndex,
                                        Reader stream,
                                        long nLength)
        Fills the prepared statement with a character stream value
        Parameters:
        nIndex - the index
        stream - the stream
        nLength - the number of characters to read
        Since:
        5.1.1
        See Also:
        PreparedStatement.setNCharacterStream(int, Reader, long)
      • getNCharacterStream

        public Reader getNCharacterStream​(int nIndex)
        Get a character stream value
        Parameters:
        nIndex - the index
        Returns:
        the stream
        Since:
        5.1.1
        See Also:
        ResultSet.getNCharacterStream(int)
      • setNString

        public void setNString​(int nIndex,
                               String strValue)
        Fills the prepared statement with a String value
        Parameters:
        nIndex - the index
        strValue - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setNString(int, String)
      • getNString

        public String getNString​(int nIndex)
        Get a String value
        Parameters:
        nIndex - the index
        Returns:
        the String
        Since:
        5.1.1
        See Also:
        ResultSet.getNString(int)
      • setNull

        public void setNull​(int nIndex,
                            int nType)
        Fills the prepared statement with a null value
        Parameters:
        nIndex - the index
        nType - the SQL type code defined in java.sql.Types
        Since:
        5.1.1
        See Also:
        PreparedStatement.setNull(int, int)
      • setNull

        public void setNull​(int nIndex,
                            int nType,
                            String strTypeName)
        Fills the prepared statement with a null value
        Parameters:
        nIndex - the index
        nType - the SQL type code defined in java.sql.Types
        strTypeName - the type name
        Since:
        5.1.1
        See Also:
        PreparedStatement.setNull(int, int, String)
      • setObject

        public void setObject​(int nIndex,
                              Object value,
                              int nType)
        Fills the prepared statement with an object value
        Parameters:
        nIndex - the index
        value - the value
        nType - the target SQL type (as defined in java.sql.Types)
        Since:
        5.1.1
        See Also:
        PreparedStatement.setObject(int, Object, int)
      • setObject

        public void setObject​(int nIndex,
                              Object value,
                              int nType,
                              int nScaleOrLength)
        Fills the prepared statement with an object value
        Parameters:
        nIndex - the index
        value - the value
        nType - the target SQL type (as defined in java.sql.Types)
        nScaleOrLength - the scale or length
        Since:
        5.1.1
        See Also:
        PreparedStatement.setObject(int, Object, int, int)
      • getRef

        public Ref getRef​(int nIndex)
        Get a Ref value
        Parameters:
        nIndex - the index
        Returns:
        the ref
        Since:
        5.1.1
        See Also:
        ResultSet.getRef(int)
      • getRef

        public Ref getRef​(String strColumnName)
        Get a Ref value
        Parameters:
        strColumnName - the column name
        Returns:
        the ref
        Since:
        5.1.1
        See Also:
        ResultSet.getRef(String)
      • setRef

        public void setRef​(int nIndex,
                           Ref ref)
        Fills the prepared statement with an Ref value
        Parameters:
        nIndex - the index
        ref - the Ref
        Since:
        5.1.1
        See Also:
        PreparedStatement.setRef(int, Ref)
      • setRowId

        public void setRowId​(int nIndex,
                             RowId rowId)
        Fills the prepared statement with a RowId value
        Parameters:
        nIndex - the index
        rowId - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setRowId(int, RowId)
      • getRowId

        public RowId getRowId​(int nIndex)
        Get a RowId value
        Parameters:
        nIndex - the index
        Returns:
        the rowId
        Since:
        5.1.1
        See Also:
        ResultSet.getRowId(int)
      • getRowId

        public RowId getRowId​(String strColumnName)
        Get a RowId value
        Parameters:
        strColumnName - the column name
        Returns:
        the rowId
        Since:
        5.1.1
        See Also:
        ResultSet.getRowId(String)
      • setShort

        public void setShort​(int nIndex,
                             short shortValue)
        Fills the prepared statement with a short value
        Parameters:
        nIndex - the index
        shortValue - the value
        Since:
        5.1.1
        See Also:
        PreparedStatement.setShort(int, short)
      • getShort

        public short getShort​(String strColumnName)
        Get a short value
        Parameters:
        strColumnName - the column name
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getShort(String)
      • getShort

        public short getShort​(int nIndex)
        Get a short value
        Parameters:
        nIndex - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getShort(int)
      • getSQLXML

        public SQLXML getSQLXML​(String strColumnName)
        Get a SQLXML value
        Parameters:
        strColumnName - the column name
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getSQLXML(String)
      • getSQLXML

        public SQLXML getSQLXML​(int nIndex)
        Get a SQLXML value
        Parameters:
        nIndex - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getSQLXML(int)
      • setURL

        public void setURL​(int nIndex,
                           URL url)
        Fills the prepared statement with a URL value
        Parameters:
        nIndex - the index
        url - the URL
        Since:
        5.1.1
        See Also:
        PreparedStatement.setURL(int, URL)
      • getURL

        public URL getURL​(String strColumnName)
        Get a URL value
        Parameters:
        strColumnName - the column name
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getURL(String)
      • getURL

        public URL getURL​(int nIndex)
        Get a URL value
        Parameters:
        nIndex - the column index
        Returns:
        the value
        Since:
        5.1.1
        See Also:
        ResultSet.getURL(int)
      • addBatch

        public void addBatch()
        Adds a set of parameters to this PreparedStatement object's batch of commands.
        Since:
        7.0.0
      • addBatch

        public void addBatch​(String sql)
        Adds the given SQL command to the current list of commands for this Statement object. The commands in this list can be executed as a batch by calling the method executeBatch.

        Note:This method cannot be called on a PreparedStatement or CallableStatement.

        Parameters:
        sql - typically this is a SQL INSERT or UPDATE statement this method is called on a closed Statement, the driver does not support batch updates, the method is called on a PreparedStatement or CallableStatement
        Since:
        7.0.0
        See Also:
        executeBatch(), DatabaseMetaData#supportsBatchUpdates
      • clearParameters

        public void clearParameters()
        Clears the current parameter values immediately.

        In general, parameter values remain in force for repeated use of a statement. Setting a parameter value automatically clears its previous value. However, in some cases it is useful to immediately release the resources used by the current parameter values; this can be done by calling the method clearParameters.

        Since:
        7.0.0
      • executeBatch

        public int[] executeBatch()
        Submits a batch of commands to the database for execution and if all commands execute successfully, returns an array of update counts.
        Returns:
        The elements of the array that is returned are ordered to correspond to the commands in the batch, which are ordered according to the order in which they were added to the batch.
        Since:
        7.0.0