Codota Logo
AbstractJdbc3Statement
Code IndexAdd Codota to your IDE (free)

How to use
AbstractJdbc3Statement
in
org.postgresql.jdbc3

Best Java code snippets using org.postgresql.jdbc3.AbstractJdbc3Statement (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: postgresql/postgresql

/**
 * Executes the given SQL statement and signals the driver that the
 * auto-generated keys indicated in the given array should be made available
 * for retrieval.  The driver will ignore the array if the SQL statement
 * is not an <code>INSERT</code> statement.
 *
 * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
 *    <code>DELETE</code> statement or an SQL statement that returns nothing
 * @param columnNames an array of the names of the columns that should be
 *    returned from the inserted row
 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
 *     or <code>DELETE</code> statements, or 0 for SQL statements
 *     that return nothing
 * @exception SQLException if a database access error occurs
 *
 * @since 1.4
 */
public int executeUpdate(String sql, String columnNames[]) throws SQLException
{
  if (columnNames == null || columnNames.length == 0)
    return executeUpdate(sql);
  sql = addReturning(connection, sql, columnNames, true);
  wantsGeneratedKeysOnce = true;
  return executeUpdate(sql);
}
origin: postgresql/postgresql

/**
 * Retrieves any auto-generated keys created as a result of executing this
 * <code>Statement</code> object. If this <code>Statement</code> object did
 * not generate any keys, an empty <code>ResultSet</code>
 * object is returned.
 *
 * @return a <code>ResultSet</code> object containing the auto-generated key(s)
 *     generated by the execution of this <code>Statement</code> object
 * @exception SQLException if a database access error occurs
 * @since 1.4
 */
public ResultSet getGeneratedKeys() throws SQLException
{
  checkClosed();
  if (generatedKeys == null || generatedKeys.getResultSet() == null)
    return createDriverResultSet(new Field[0], new Vector());
  return generatedKeys.getResultSet();
}
origin: postgresql/postgresql

  return execute(sql);
sql = addReturning(connection, sql, new String[]{"*"}, false);
wantsGeneratedKeysOnce = true;
return execute(sql);
origin: postgresql/postgresql

public void setObject(int parameterIndex, Object x) throws SQLException
{
  if (x instanceof UUID && connection.haveMinimumServerVersion("8.3"))
  {
    setString(parameterIndex, x.toString(), Oid.UUID);
  } else {
    super.setObject(parameterIndex, x);
  }
}
origin: postgresql/postgresql

sql = AbstractJdbc3Statement.addReturning(this, sql, columnNames, true);
origin: postgresql/postgresql

  public void registerOutParameter(int parameterIndex, int sqlType,
      int scale) throws SQLException
  {
    // ignore scale for now
    registerOutParameter(parameterIndex, sqlType );
  }
}
origin: postgresql/postgresql

/**
 * Retrieves the number, types and properties of this
 * <code>PreparedStatement</code> object's parameters.
 *
 * @return a <code>ParameterMetaData</code> object that contains information
 *     about the number, types and properties of this
 *     <code>PreparedStatement</code> object's parameters
 * @exception SQLException if a database access error occurs
 * @see ParameterMetaData
 * @since 1.4
 */
public ParameterMetaData getParameterMetaData() throws SQLException
{
  int flags = QueryExecutor.QUERY_ONESHOT | QueryExecutor.QUERY_DESCRIBE_ONLY | QueryExecutor.QUERY_SUPPRESS_BEGIN;
  StatementResultHandler handler = new StatementResultHandler();
  connection.getQueryExecutor().execute(preparedQuery, preparedParameters, handler, 0, 0, flags);
  int oids[] = preparedParameters.getTypeOIDs();
  if (oids != null)
    return createParameterMetaData(connection, oids);
  return null;
}
origin: postgresql/postgresql

/**
 * Executes the given SQL statement and signals the driver that the
 * auto-generated keys indicated in the given array should be made available
 * for retrieval.  The driver will ignore the array if the SQL statement
 * is not an <code>INSERT</code> statement.
 *
 * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
 *    <code>DELETE</code> statement or an SQL statement that returns nothing,
 *    such as an SQL DDL statement
 * @param columnIndexes an array of column indexes indicating the columns
 *    that should be returned from the inserted row
 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
 *     or <code>DELETE</code> statements, or 0 for SQL statements
 *     that return nothing
 * @exception SQLException if a database access error occurs or the SQL
 *     statement returns a <code>ResultSet</code> object
 * @since 1.4
 */
public int executeUpdate(String sql, int columnIndexes[]) throws SQLException
{
  if (columnIndexes == null || columnIndexes.length == 0)
    return executeUpdate(sql);
  throw new PSQLException(GT.tr("Returning autogenerated keys by column index is not supported."), PSQLState.NOT_IMPLEMENTED);
}
origin: postgresql/postgresql

return execute(sql);
origin: postgresql/postgresql

  public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException
  {
    if (targetSqlType == Types.OTHER && x instanceof UUID && connection.haveMinimumServerVersion("8.3"))
    {
      setString(parameterIndex, x.toString(), Oid.UUID);
    } else {
      super.setObject(parameterIndex, x, targetSqlType, scale);
    }
  }
}
origin: postgresql/postgresql

sql = AbstractJdbc3Statement.addReturning(this, sql, new String[]{"*"}, false);
origin: org.ancoron.postgresql/org.postgresql

  public void registerOutParameter(int parameterIndex, int sqlType,
      int scale) throws SQLException
  {
    // ignore scale for now
    registerOutParameter(parameterIndex, sqlType );
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Retrieves the number, types and properties of this
 * <code>PreparedStatement</code> object's parameters.
 *
 * @return a <code>ParameterMetaData</code> object that contains information
 *     about the number, types and properties of this
 *     <code>PreparedStatement</code> object's parameters
 * @exception SQLException if a database access error occurs
 * @see ParameterMetaData
 * @since 1.4
 */
public ParameterMetaData getParameterMetaData() throws SQLException
{
  int flags = QueryExecutor.QUERY_ONESHOT | QueryExecutor.QUERY_DESCRIBE_ONLY | QueryExecutor.QUERY_SUPPRESS_BEGIN;
  StatementResultHandler handler = new StatementResultHandler();
  connection.getQueryExecutor().execute(preparedQuery, preparedParameters, handler, 0, 0, flags);
  int oids[] = preparedParameters.getTypeOIDs();
  if (oids != null)
    return createParameterMetaData(connection, oids);
  return null;
}
origin: org.ancoron.postgresql/org.postgresql

/**
 * Executes the given SQL statement and signals the driver that the
 * auto-generated keys indicated in the given array should be made available
 * for retrieval.  The driver will ignore the array if the SQL statement
 * is not an <code>INSERT</code> statement.
 *
 * @param sql an SQL <code>INSERT</code>, <code>UPDATE</code> or
 *    <code>DELETE</code> statement or an SQL statement that returns nothing,
 *    such as an SQL DDL statement
 * @param columnIndexes an array of column indexes indicating the columns
 *    that should be returned from the inserted row
 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>,
 *     or <code>DELETE</code> statements, or 0 for SQL statements
 *     that return nothing
 * @exception SQLException if a database access error occurs or the SQL
 *     statement returns a <code>ResultSet</code> object
 * @since 1.4
 */
public int executeUpdate(String sql, int columnIndexes[]) throws SQLException
{
  if (columnIndexes == null || columnIndexes.length == 0)
    return executeUpdate(sql);
  throw new PSQLException(GT.tr("Returning autogenerated keys by column index is not supported."), PSQLState.NOT_IMPLEMENTED);
}
origin: org.ancoron.postgresql/org.postgresql

return execute(sql);
origin: postgresql/postgresql

/**
 * Executes the given SQL statement and signals the driver with the
 * given flag about whether the
 * auto-generated keys produced by this <code>Statement</code> object
 * should be made available for retrieval.
 *
 * @param sql must be an SQL <code>INSERT</code>, <code>UPDATE</code> or
 *    <code>DELETE</code> statement or an SQL statement that
 *    returns nothing
 * @param autoGeneratedKeys a flag indicating whether auto-generated keys
 *    should be made available for retrieval;
 *     one of the following constants:
 *     <code>Statement.RETURN_GENERATED_KEYS</code>
 *     <code>Statement.NO_GENERATED_KEYS</code>
 * @return either the row count for <code>INSERT</code>, <code>UPDATE</code>
 *     or <code>DELETE</code> statements, or <code>0</code> for SQL
 *     statements that return nothing
 * @exception SQLException if a database access error occurs, the given
 *     SQL statement returns a <code>ResultSet</code> object, or
 *     the given constant is not one of those allowed
 * @since 1.4
 */
public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException
{
  if (autoGeneratedKeys == Statement.NO_GENERATED_KEYS)
    return executeUpdate(sql);
  sql = addReturning(connection, sql, new String[]{"*"}, false);
  wantsGeneratedKeysOnce = true;
  return executeUpdate(sql);
}
origin: postgresql/postgresql

  return execute(sql);
sql = addReturning(connection, sql, columnNames, true);
wantsGeneratedKeysOnce = true;
return execute(sql);
origin: org.ancoron.postgresql/org.postgresql

/**
 * Retrieves any auto-generated keys created as a result of executing this
 * <code>Statement</code> object. If this <code>Statement</code> object did
 * not generate any keys, an empty <code>ResultSet</code>
 * object is returned.
 *
 * @return a <code>ResultSet</code> object containing the auto-generated key(s)
 *     generated by the execution of this <code>Statement</code> object
 * @exception SQLException if a database access error occurs
 * @since 1.4
 */
public ResultSet getGeneratedKeys() throws SQLException
{
  checkClosed();
  if (generatedKeys == null || generatedKeys.getResultSet() == null)
    return createDriverResultSet(new Field[0], new Vector());
  return generatedKeys.getResultSet();
}
origin: org.ancoron.postgresql/org.postgresql

public void setObject(int parameterIndex, Object x) throws SQLException
{
  if (x instanceof UUID && connection.haveMinimumServerVersion("8.3"))
  {
    setString(parameterIndex, x.toString(), Oid.UUID);
  } else {
    super.setObject(parameterIndex, x);
  }
}
origin: org.ancoron.postgresql/org.postgresql.osgi

sql = AbstractJdbc3Statement.addReturning(this, sql, new String[]{"*"}, false);
org.postgresql.jdbc3AbstractJdbc3Statement

Javadoc

This class defines methods of the jdbc3 specification. This class extends org.postgresql.jdbc2.AbstractJdbc2Statement which provides the jdbc2 methods. The real Statement class (for jdbc2) is org.postgresql.jdbc3.Jdbc3Statement

Most used methods

  • addReturning
  • checkClosed
  • createDriverResultSet
  • createParameterMetaData
  • execute
    Executes the given SQL statement, which may return multiple results, and signals the driver that the
  • executeUpdate
    Executes the given SQL statement and signals the driver that the auto-generated keys indicated in th
  • registerOutParameter
    Registers the designated output parameter. This version of the method registerOutParameter should b
  • setObject
    Sets the value of the designated parameter with the given object. The second argument must be an obj

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • onCreateOptionsMenu (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ImageIO (javax.imageio)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now