SQLException.<init>
Code IndexAdd Codota to your IDE (free)

Best code snippets using java.sql.SQLException.<init>(Showing top 15 results out of 4,338)

  • Common ways to obtain SQLException
private void myMethod () {
SQLException s =
  • new SQLException()
  • Throwable theCause;new SQLException(theCause)
  • String str;new SQLException(str, theCause)
  • AI code suggestions by Codota
}
origin: spring-projects/spring-boot

@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
  if (isWrapperFor(iface)) {
    return (T) this;
  }
  if (ClassUtils.isAssignableValue(iface, this.xaDataSource)) {
    return (T) this.xaDataSource;
  }
  throw new SQLException(getClass() + " is not a wrapper for " + iface);
}
origin: prestodb/presto

@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> iface)
    throws SQLException
{
  if (isWrapperFor(iface)) {
    return (T) this;
  }
  throw new SQLException("No wrapper for " + iface);
}
origin: prestodb/presto

@Override
public ResultSet executeQuery(String sql)
    throws SQLException
{
  if (!execute(sql)) {
    throw new SQLException("SQL statement is not a query: " + sql);
  }
  return currentResult.get();
}
origin: prestodb/presto

@Override
public void rollback()
    throws SQLException
{
  checkOpen();
  if (getAutoCommit()) {
    throw new SQLException("Connection is in auto-commit mode");
  }
  try (PrestoStatement statement = new PrestoStatement(this)) {
    statement.internalExecute("ROLLBACK");
  }
}
origin: prestodb/presto

private ColumnInfo columnInfo(int index)
    throws SQLException
{
  checkOpen();
  checkValidRow();
  if ((index <= 0) || (index > columnInfoList.size())) {
    throw new SQLException("Invalid column index: " + index);
  }
  return columnInfoList.get(index - 1);
}
origin: prestodb/presto

@Override
public void setNetworkTimeout(Executor executor, int milliseconds)
    throws SQLException
{
  checkOpen();
  if (milliseconds < 0) {
    throw new SQLException("Timeout is negative");
  }
  networkTimeoutMillis.set(milliseconds);
}
origin: prestodb/presto

@Override
public void validate(Properties properties)
    throws SQLException
{
  if (!isAllowed(properties)) {
    throw new SQLException(format("Connection property '%s' is not allowed", key));
  }
  getValue(properties);
}
origin: prestodb/presto

@Override
public void setQueryTimeout(int seconds)
    throws SQLException
{
  checkOpen();
  if (seconds < 0) {
    throw new SQLException("Query timeout seconds must be positive");
  }
  queryTimeoutSeconds.set(seconds);
}
origin: prestodb/presto

@Override
public int getMaxRows()
    throws SQLException
{
  long result = getLargeMaxRows();
  if (result > Integer.MAX_VALUE) {
    throw new SQLException("Max rows exceeds limit of 2147483647");
  }
  return toIntExact(result);
}
origin: prestodb/presto

@Override
public void setFetchDirection(int direction)
    throws SQLException
{
  checkOpen();
  if (direction != FETCH_FORWARD) {
    throw new SQLException("Fetch direction must be FETCH_FORWARD");
  }
}
origin: prestodb/presto

@SuppressWarnings("unchecked")
@Override
public <T> T unwrap(Class<T> iface)
    throws SQLException
{
  if (isWrapperFor(iface)) {
    return (T) this;
  }
  throw new SQLException("No wrapper for " + iface);
}
origin: prestodb/presto

@Override
public void setLargeMaxRows(long max)
    throws SQLException
{
  checkOpen();
  if (max < 0) {
    throw new SQLException("Max rows must be positive");
  }
  maxRows.set(max);
}
origin: prestodb/presto

@Override
public boolean isValid(int timeout)
    throws SQLException
{
  if (timeout < 0) {
    throw new SQLException("Timeout is negative");
  }
  return !isClosed();
}
origin: prestodb/presto

@Override
public void setMaxFieldSize(int max)
    throws SQLException
{
  checkOpen();
  if (max < 0) {
    throw new SQLException("Max field size must be positive");
  }
  // ignore: full values are always returned
}
origin: prestodb/presto

  @Override
  public void addBatch(String sql)
      throws SQLException
  {
    throw new SQLException("This method cannot be called on PreparedStatement");
  }
}
java.sqlSQLException<init>

Javadoc

Creates an SQLException object. The reason string is set to null, the SQLState string is set to null and the error code is set to 0.

Popular methods of SQLException

  • getMessage
  • getSQLState
    Retrieves the SQLState description string for this SQLException object.
  • getErrorCode
    Returns the integer error code for this SQLException.
  • printStackTrace
  • getNextException
    Retrieves the SQLException chained to this SQLException, if any.
  • toString
  • setNextException
    Obsolete. Appends ex to the end of this chain.
  • initCause
  • getCause
  • getLocalizedMessage
  • fillInStackTrace
  • getStackTrace
  • fillInStackTrace,
  • getStackTrace,
  • addSuppressed,
  • getSuppressed,
  • iterator,
  • setStackTrace

Popular classes and methods

  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • setRequestProperty (URLConnection)
    Sets the value of the specified request header field. The value will only be used by the current URL
  • Component (java.awt)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)