For IntelliJ IDEA and
Android Studio


private void myMethod () {SQLException s =
new SQLException()
Throwable theCause;new SQLException(theCause)
String str;new SQLException(str, theCause)
- AI code suggestions by Codota
}
@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); }
@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); }
@Override public ResultSet executeQuery(String sql) throws SQLException { if (!execute(sql)) { throw new SQLException("SQL statement is not a query: " + sql); } return currentResult.get(); }
@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"); } }
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); }
@Override public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { checkOpen(); if (milliseconds < 0) { throw new SQLException("Timeout is negative"); } networkTimeoutMillis.set(milliseconds); }
@Override public void validate(Properties properties) throws SQLException { if (!isAllowed(properties)) { throw new SQLException(format("Connection property '%s' is not allowed", key)); } getValue(properties); }
@Override public void setQueryTimeout(int seconds) throws SQLException { checkOpen(); if (seconds < 0) { throw new SQLException("Query timeout seconds must be positive"); } queryTimeoutSeconds.set(seconds); }
@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); }
@Override public void setFetchDirection(int direction) throws SQLException { checkOpen(); if (direction != FETCH_FORWARD) { throw new SQLException("Fetch direction must be FETCH_FORWARD"); } }
@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); }
@Override public void setLargeMaxRows(long max) throws SQLException { checkOpen(); if (max < 0) { throw new SQLException("Max rows must be positive"); } maxRows.set(max); }
@Override public boolean isValid(int timeout) throws SQLException { if (timeout < 0) { throw new SQLException("Timeout is negative"); } return !isClosed(); }
@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 }
@Override public void addBatch(String sql) throws SQLException { throw new SQLException("This method cannot be called on PreparedStatement"); } }