public interface ICallableStatement extends IPreparedStatement {

	public SArray getArray(int parameterIndex) throws SQLException, RemoteException;
	public SArray getArray(String parameterName) throws SQLException, RemoteException;
	public BigDecimal getBigDecimal(int parameterIndex) throws SQLException, RemoteException;
	public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException, RemoteException;
	public BigDecimal getBigDecimal(String parameterName) throws SQLException, RemoteException;
	public SBlob getBlob(int parameterIndex) throws SQLException, RemoteException;
	public SBlob getBlob(String parameterName) throws SQLException, RemoteException;
	public boolean getBoolean(int parameterIndex) throws SQLException, RemoteException;
	public boolean getBoolean(String parameterName) throws SQLException, RemoteException;
	public byte getByte(int parameterIndex) throws SQLException, RemoteException;
	public byte getByte(String parameterName) throws SQLException, RemoteException;
	public byte[] getBytes(int parameterIndex) throws SQLException, RemoteException;
	public byte[] getBytes(String parameterName) throws SQLException, RemoteException;
	public SClob getClob(int parameterIndex) throws SQLException, RemoteException;
	public SClob getClob(String parameterName) throws SQLException, RemoteException;
	public Date getDate(int parameterIndex) throws SQLException, RemoteException;
	public Date getDate(int parameterIndex, Calendar cal) throws SQLException, RemoteException;
	public Date getDate(String parameterName) throws SQLException, RemoteException;
	public Date getDate(String parameterName, Calendar cal) throws SQLException, RemoteException;
	public double getDouble(int parameterIndex) throws SQLException, RemoteException;
	public double getDouble(String parameterName) throws SQLException, RemoteException;
	public float getFloat(int parameterIndex) throws SQLException, RemoteException;
	public float getFloat(String parameterName) throws SQLException, RemoteException;
	public int getInt(int parameterIndex) throws SQLException, RemoteException;
	public int getInt(String parameterName) throws SQLException, RemoteException;
	public long getLong(int parameterIndex) throws SQLException, RemoteException;
	public long getLong(String parameterName) throws SQLException, RemoteException;
	public Object getObject(int parameterIndex) throws SQLException, RemoteException;
	public Object getObject(int parameterIndex, Map<String, Class<?>> map) throws SQLException, RemoteException;
	public Object getObject(String parameterName) throws SQLException, RemoteException;
	public Object getObject(String parameterName, Map<String, Class<?>> map) throws SQLException, RemoteException;
	public SRef getRef(int parameterIndex) throws SQLException, RemoteException;
	public SRef getRef(String parameterName) throws SQLException, RemoteException;
	public short getShort(int parameterIndex) throws SQLException, RemoteException;
	public short getShort(String parameterName) throws SQLException, RemoteException;
	public String getString(int parameterIndex) throws SQLException, RemoteException;
	public String getString(String parameterName) throws SQLException, RemoteException;
	public Time getTime(int parameterIndex) throws SQLException, RemoteException;
	public Time getTime(int parameterIndex, Calendar cal) throws SQLException, RemoteException;
	public Time getTime(String parameterName) throws SQLException, RemoteException;
	public Time getTime(String parameterName, Calendar cal) throws SQLException, RemoteException;
	public Timestamp getTimestamp(int parameterIndex) throws SQLException, RemoteException;
	public Timestamp getTimestamp(int parameterIndex, Calendar cal) throws SQLException, RemoteException;
	public Timestamp getTimestamp(String parameterName) throws SQLException, RemoteException;
	public Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException, RemoteException;
	public URL getURL(int parameterIndex) throws SQLException, RemoteException;
	public URL getURL(String parameterName) throws SQLException, RemoteException;
	public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException, RemoteException;
	public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException, RemoteException;
	public void registerOutParameter(int paramIndex, int sqlType, String typeName) throws SQLException, RemoteException;
	public void registerOutParameter(String parameterName, int sqlType) throws SQLException, RemoteException;
	public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException, RemoteException;
	public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException, RemoteException;
	public void setAsciiStream(String parameterName, SInputStream theInputStream, int length) throws SQLException, RemoteException;
	public void setBigDecimal(String parameterName, BigDecimal theBigDecimal) throws SQLException, RemoteException;
	public void setBinaryStream(String parameterName, SInputStream theInputStream, int length) throws SQLException, RemoteException;
	public void setBoolean(String parameterName, boolean theBoolean) throws SQLException, RemoteException;
	public void setByte(String parameterName, byte theByte) throws SQLException, RemoteException;
	public void setBytes(String parameterName, byte[] theBytes) throws SQLException, RemoteException;
	public void setCharacterStream(String parameterName, SReader reader, int length) throws SQLException, RemoteException;
	public void setDate(String parameterName, Date theDate) throws SQLException, RemoteException;
	public void setDate(String parameterName, Date theDate, Calendar cal) throws SQLException, RemoteException;
	public void setDouble(String parameterName, double theDouble) throws SQLException, RemoteException;
	public void setFloat(String parameterName, float theFloat) throws SQLException, RemoteException;
	public void setInt(String parameterName, int theInt) throws SQLException, RemoteException;
	public void setLong(String parameterName, long theLong) throws SQLException, RemoteException;
	public void setNull(String parameterName, int sqlType) throws SQLException, RemoteException;
	public void setNull(String parameterName, int sqlType, String typeName) throws SQLException, RemoteException;
	public void setObject(String parameterName, Object theObject) throws SQLException, RemoteException;
	public void setObject(String parameterName, Object theObject, int targetSqlType) throws SQLException, RemoteException;
	public void setObject(String parameterName, Object theObject, int targetSqlType, int scale) throws SQLException, RemoteException;
	public void setShort(String parameterName, short theShort) throws SQLException, RemoteException;
	public void setString(String parameterName, String theString) throws SQLException, RemoteException;
	public void setTime(String parameterName, Time theTime) throws SQLException, RemoteException;
	public void setTime(String parameterName, Time theTime, Calendar cal) throws SQLException, RemoteException;
	public void setTimestamp(String parameterName, Timestamp theTimestamp) throws SQLException, RemoteException;
	public void setTimestamp(String parameterName, Timestamp theTimestamp, Calendar cal) throws SQLException, RemoteException;
	public void setURL(String parameterName, URL theURL) throws SQLException, RemoteException;
	public boolean wasNull() throws SQLException, RemoteException;
	public SRowId getRowId(int parameterIndex) throws SQLException, RemoteException;
	public SRowId getRowId(String parameterName) throws SQLException, RemoteException;
	public void setRowId(String parameterName, SRowId x) throws SQLException, RemoteException;
	public void setNString(String parameterName, String value) throws SQLException, RemoteException;
	public void setNCharacterStream(String parameterName, SReader value, long length) throws SQLException, RemoteException;
	public void setNClob(String parameterName, SNClob value) throws SQLException, RemoteException;
	public void setClob(String parameterName, SReader reader, long length) throws SQLException, RemoteException;
	public void setBlob(String parameterName, SInputStream inputStream, long length) throws SQLException, RemoteException;
	public void setNClob(String parameterName, SReader reader, long length) throws SQLException, RemoteException;
	public SNClob getNClob(int parameterIndex) throws SQLException, RemoteException;
	public SNClob getNClob(String parameterName) throws SQLException, RemoteException;
	public void setSQLXML(String parameterName, SSQLXML xmlObject) throws SQLException, RemoteException;
	public SSQLXML getSQLXML(int parameterIndex) throws SQLException, RemoteException;
	public SSQLXML getSQLXML(String parameterName) throws SQLException, RemoteException;
	public String getNString(int parameterIndex) throws SQLException, RemoteException;
	public String getNString(String parameterName) throws SQLException, RemoteException;
	public SReader getNCharacterStream(int parameterIndex) throws SQLException, RemoteException;
	public SReader getNCharacterStream(String parameterName) throws SQLException, RemoteException;
	public SReader getCharacterStream(int parameterIndex) throws SQLException, RemoteException;
	public SReader getCharacterStream(String parameterName) throws SQLException, RemoteException;
	public void setBlob(String parameterName, SBlob x) throws SQLException, RemoteException;
	public void setClob(String parameterName, SClob x) throws SQLException, RemoteException;
	public void setAsciiStream(String parameterName, SInputStream x, long length) throws SQLException, RemoteException;
	public void setBinaryStream(String parameterName, SInputStream x, long length) throws SQLException, RemoteException;
	public void setCharacterStream(String parameterName, SReader reader, long length) throws SQLException, RemoteException;
	public void setAsciiStream(String parameterName, SInputStream x) throws SQLException, RemoteException;
	public void setBinaryStream(String parameterName, SInputStream x) throws SQLException, RemoteException;
	public void setCharacterStream(String parameterName, SReader reader) throws SQLException, RemoteException;
	public void setNCharacterStream(String parameterName, SReader value) throws SQLException, RemoteException;
	public void setClob(String parameterName, SReader reader) throws SQLException, RemoteException;
	public void setBlob(String parameterName, SInputStream inputStream) throws SQLException, RemoteException;
	public void setNClob(String parameterName, SReader reader) throws SQLException, RemoteException;
}
 public interface IConnection extends IRemoteObject {

	// Regular Connection methods
	public void clearWarnings() throws SQLException, RemoteException;
	public void close() throws SQLException, RemoteException;
	public void commit() throws SQLException, RemoteException;
	public IStatement createStatement() throws SQLException, RemoteException;
	public IStatement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException, RemoteException;
	public IStatement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException, RemoteException;
	public boolean getAutoCommit() throws SQLException, RemoteException;
	public String getCatalog() throws SQLException, RemoteException;
	public int getHoldability() throws SQLException, RemoteException;
	public IDatabaseMetaData getMetaData() throws SQLException, RemoteException;
	public int getTransactionIsolation() throws SQLException, RemoteException;
	public Map<String, Class<?>> getTypeMap() throws SQLException, RemoteException;
	public SQLWarning getWarnings() throws SQLException, RemoteException;
	public boolean isClosed() throws SQLException, RemoteException;
	public boolean isReadOnly() throws SQLException, RemoteException;
	public String nativeSQL(String sql) throws SQLException, RemoteException;
	public ICallableStatement prepareCall(String sql) throws SQLException, RemoteException;
	public ICallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException, RemoteException;
	public ICallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException, RemoteException;
	public IPreparedStatement prepareStatement(String sql) throws SQLException, RemoteException;
	public IPreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException, RemoteException;
	public IPreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException, RemoteException;
	public IPreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException, RemoteException;
	public IPreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException, RemoteException;
	public IPreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException, RemoteException;
	public void releaseSavepoint(SSavepoint savepoint) throws SQLException, RemoteException;
	public void rollback() throws SQLException, RemoteException;
	public void rollback(SSavepoint savepoint) throws SQLException, RemoteException;
	public void setAutoCommit(boolean autoCommit) throws SQLException, RemoteException;
	public void setCatalog(String catalog) throws SQLException, RemoteException;
	public void setHoldability(int holdability) throws SQLException, RemoteException;
	public void setReadOnly(boolean readOnly) throws SQLException, RemoteException;
	public SSavepoint setSavepoint() throws SQLException, RemoteException;
	public SSavepoint setSavepoint(String name) throws SQLException, RemoteException;
	public void setTransactionIsolation(int level) throws SQLException, RemoteException;
	public void setTypeMap(Map<String, Class<?>> map) throws SQLException, RemoteException;
	public SClob createClob() throws SQLException, RemoteException;
	public SBlob createBlob() throws SQLException, RemoteException;
	public SNClob createNClob() throws SQLException, RemoteException;
	public SSQLXML createSQLXML() throws SQLException, RemoteException;
	public boolean isValid(int timeout) throws SQLException, RemoteException;
	public void setClientInfo(String name, String value) throws SQLClientInfoException, RemoteException;
	public void setClientInfo(Properties properties) throws SQLClientInfoException, RemoteException;
	public String getClientInfo(String name) throws SQLException, RemoteException;
	public Properties getClientInfo() throws SQLException, RemoteException;
	public SArray createArrayOf(String typeName, Object[] elements) throws SQLException, RemoteException;
	public SStruct createStruct(String typeName, Object[] attributes) throws SQLException, RemoteException;
	
	// Extra methods
}
 public interface IDatabaseMetaData extends IRemoteObject {

	public boolean allProceduresAreCallable() throws SQLException, RemoteException;
	public boolean allTablesAreSelectable() throws SQLException, RemoteException;
	public boolean dataDefinitionCausesTransactionCommit() throws SQLException, RemoteException;
	public boolean dataDefinitionIgnoredInTransactions() throws SQLException, RemoteException;
	public boolean deletesAreDetected(int type) throws SQLException, RemoteException;
	public boolean doesMaxRowSizeIncludeBlobs() throws SQLException, RemoteException;
	public IResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException, RemoteException;
	public IResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException, RemoteException;
	public IResultSet getCatalogs() throws SQLException, RemoteException;
	public String getCatalogSeparator() throws SQLException, RemoteException;
	public String getCatalogTerm() throws SQLException, RemoteException;
	public IResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException, RemoteException;
	public IResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException, RemoteException;
	public IResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException, RemoteException;
	public int getDatabaseMajorVersion() throws SQLException, RemoteException;
	public int getDatabaseMinorVersion() throws SQLException, RemoteException;
	public String getDatabaseProductName() throws SQLException, RemoteException;
	public String getDatabaseProductVersion() throws SQLException, RemoteException;
	public int getDefaultTransactionIsolation() throws SQLException, RemoteException;
	public int getDriverMajorVersion() throws SQLException, RemoteException;
	public int getDriverMinorVersion() throws SQLException, RemoteException;
	public String getDriverName() throws SQLException, RemoteException;
	public String getDriverVersion() throws SQLException, RemoteException;
	public IResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException, RemoteException;
	public String getExtraNameCharacters() throws SQLException, RemoteException;
	public String getIdentifierQuoteString() throws SQLException, RemoteException;
	public IResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException, RemoteException;
	public IResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException, RemoteException;
	public int getJDBCMajorVersion() throws SQLException, RemoteException;
	public int getJDBCMinorVersion() throws SQLException, RemoteException;
	public int getMaxBinaryLiteralLength() throws SQLException, RemoteException;
	public int getMaxCatalogNameLength() throws SQLException, RemoteException;
	public int getMaxCharLiteralLength() throws SQLException, RemoteException;
	public int getMaxColumnNameLength() throws SQLException, RemoteException;
	public int getMaxColumnsInGroupBy() throws SQLException, RemoteException;
	public int getMaxColumnsInIndex() throws SQLException, RemoteException;
	public int getMaxColumnsInOrderBy() throws SQLException, RemoteException;
	public int getMaxColumnsInSelect() throws SQLException, RemoteException;
	public int getMaxColumnsInTable() throws SQLException, RemoteException;
	public int getMaxConnections() throws SQLException, RemoteException;
	public int getMaxCursorNameLength() throws SQLException, RemoteException;
	public int getMaxIndexLength() throws SQLException, RemoteException;
	public int getMaxProcedureNameLength() throws SQLException, RemoteException;
	public int getMaxRowSize() throws SQLException, RemoteException;
	public int getMaxSchemaNameLength() throws SQLException, RemoteException;
	public int getMaxStatementLength() throws SQLException, RemoteException;
	public int getMaxStatements() throws SQLException, RemoteException;
	public int getMaxTableNameLength() throws SQLException, RemoteException;
	public int getMaxTablesInSelect() throws SQLException, RemoteException;
	public int getMaxUserNameLength() throws SQLException, RemoteException;
	public String getNumericFunctions() throws SQLException, RemoteException;
	public IResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException, RemoteException;
	public IResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException, RemoteException;
	public IResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException, RemoteException;
	public String getProcedureTerm() throws SQLException, RemoteException;
	public int getResultSetHoldability() throws SQLException, RemoteException;
	public IResultSet getSchemas() throws SQLException, RemoteException;
	public String getSchemaTerm() throws SQLException, RemoteException;
	public String getSearchStringEscape() throws SQLException, RemoteException;
	public String getSQLKeywords() throws SQLException, RemoteException;
	public int getSQLStateType() throws SQLException, RemoteException;
	public String getStringFunctions() throws SQLException, RemoteException;
	public IResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException, RemoteException;
	public IResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException, RemoteException;
	public String getSystemFunctions() throws SQLException, RemoteException;
	public IResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException, RemoteException;
	public IResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException, RemoteException;
	public IResultSet getTableTypes() throws SQLException, RemoteException;
	public String getTimeDateFunctions() throws SQLException, RemoteException;
	public IResultSet getTypeInfo() throws SQLException, RemoteException;
	public IResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException, RemoteException;
	public String getURL() throws SQLException, RemoteException;
	public String getUserName() throws SQLException, RemoteException;
	public IResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException, RemoteException;
	public boolean insertsAreDetected(int type) throws SQLException, RemoteException;
	public boolean isCatalogAtStart() throws SQLException, RemoteException;
	public boolean isReadOnly() throws SQLException, RemoteException;
	public boolean locatorsUpdateCopy() throws SQLException, RemoteException;
	public boolean nullPlusNonNullIsNull() throws SQLException, RemoteException;
	public boolean nullsAreSortedAtEnd() throws SQLException, RemoteException;
	public boolean nullsAreSortedAtStart() throws SQLException, RemoteException;
	public boolean nullsAreSortedHigh() throws SQLException, RemoteException;
	public boolean nullsAreSortedLow() throws SQLException, RemoteException;
	public boolean othersDeletesAreVisible(int type) throws SQLException, RemoteException;
	public boolean othersInsertsAreVisible(int type) throws SQLException, RemoteException;
	public boolean othersUpdatesAreVisible(int type) throws SQLException, RemoteException;
	public boolean ownDeletesAreVisible(int type) throws SQLException, RemoteException;
	public boolean ownInsertsAreVisible(int type) throws SQLException, RemoteException;
	public boolean ownUpdatesAreVisible(int type) throws SQLException, RemoteException;
	public boolean storesLowerCaseIdentifiers() throws SQLException, RemoteException;
	public boolean storesLowerCaseQuotedIdentifiers() throws SQLException, RemoteException;
	public boolean storesMixedCaseIdentifiers() throws SQLException, RemoteException;
	public boolean storesMixedCaseQuotedIdentifiers() throws SQLException, RemoteException;
	public boolean storesUpperCaseIdentifiers() throws SQLException, RemoteException;
	public boolean storesUpperCaseQuotedIdentifiers() throws SQLException, RemoteException;
	public boolean supportsAlterTableWithAddColumn() throws SQLException, RemoteException;
	public boolean supportsAlterTableWithDropColumn() throws SQLException, RemoteException;
	public boolean supportsANSI92EntryLevelSQL() throws SQLException, RemoteException;
	public boolean supportsANSI92FullSQL() throws SQLException, RemoteException;
	public boolean supportsANSI92IntermediateSQL() throws SQLException, RemoteException;
	public boolean supportsBatchUpdates() throws SQLException, RemoteException;
	public boolean supportsCatalogsInDataManipulation() throws SQLException, RemoteException;
	public boolean supportsCatalogsInIndexDefinitions() throws SQLException, RemoteException;
	public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException, RemoteException;
	public boolean supportsCatalogsInProcedureCalls() throws SQLException, RemoteException;
	public boolean supportsCatalogsInTableDefinitions() throws SQLException, RemoteException;
	public boolean supportsColumnAliasing() throws SQLException, RemoteException;
	public boolean supportsConvert() throws SQLException, RemoteException;
	public boolean supportsConvert(int fromType, int toType) throws SQLException, RemoteException;
	public boolean supportsCoreSQLGrammar() throws SQLException, RemoteException;
	public boolean supportsCorrelatedSubqueries() throws SQLException, RemoteException;
	public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException, RemoteException;
	public boolean supportsDataManipulationTransactionsOnly() throws SQLException, RemoteException;
	public boolean supportsDifferentTableCorrelationNames() throws SQLException, RemoteException;
	public boolean supportsExpressionsInOrderBy() throws SQLException, RemoteException;
	public boolean supportsExtendedSQLGrammar() throws SQLException, RemoteException;
	public boolean supportsFullOuterJoins() throws SQLException, RemoteException;
	public boolean supportsGetGeneratedKeys() throws SQLException, RemoteException;
	public boolean supportsGroupBy() throws SQLException, RemoteException;
	public boolean supportsGroupByBeyondSelect() throws SQLException, RemoteException;
	public boolean supportsGroupByUnrelated() throws SQLException, RemoteException;
	public boolean supportsIntegrityEnhancementFacility() throws SQLException, RemoteException;
	public boolean supportsLikeEscapeClause() throws SQLException, RemoteException;
	public boolean supportsLimitedOuterJoins() throws SQLException, RemoteException;
	public boolean supportsMinimumSQLGrammar() throws SQLException, RemoteException;
	public boolean supportsMixedCaseIdentifiers() throws SQLException, RemoteException;
	public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException, RemoteException;
	public boolean supportsMultipleOpenResults() throws SQLException, RemoteException;
	public boolean supportsMultipleResultSets() throws SQLException, RemoteException;
	public boolean supportsMultipleTransactions() throws SQLException, RemoteException;
	public boolean supportsNamedParameters() throws SQLException, RemoteException;
	public boolean supportsNonNullableColumns() throws SQLException, RemoteException;
	public boolean supportsOpenCursorsAcrossCommit() throws SQLException, RemoteException;
	public boolean supportsOpenCursorsAcrossRollback() throws SQLException, RemoteException;
	public boolean supportsOpenStatementsAcrossCommit() throws SQLException, RemoteException;
	public boolean supportsOpenStatementsAcrossRollback() throws SQLException, RemoteException;
	public boolean supportsOrderByUnrelated() throws SQLException, RemoteException;
	public boolean supportsOuterJoins() throws SQLException, RemoteException;
	public boolean supportsPositionedDelete() throws SQLException, RemoteException;
	public boolean supportsPositionedUpdate() throws SQLException, RemoteException;
	public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException, RemoteException;
	public boolean supportsResultSetHoldability(int holdability) throws SQLException, RemoteException;
	public boolean supportsResultSetType(int type) throws SQLException, RemoteException;
	public boolean supportsSavepoints() throws SQLException, RemoteException;
	public boolean supportsSchemasInDataManipulation() throws SQLException, RemoteException;
	public boolean supportsSchemasInIndexDefinitions() throws SQLException, RemoteException;
	public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException, RemoteException;
	public boolean supportsSchemasInProcedureCalls() throws SQLException, RemoteException;
	public boolean supportsSchemasInTableDefinitions() throws SQLException, RemoteException;
	public boolean supportsSelectForUpdate() throws SQLException, RemoteException;
	public boolean supportsStatementPooling() throws SQLException, RemoteException;
	public boolean supportsStoredProcedures() throws SQLException, RemoteException;
	public boolean supportsSubqueriesInComparisons() throws SQLException, RemoteException;
	public boolean supportsSubqueriesInExists() throws SQLException, RemoteException;
	public boolean supportsSubqueriesInIns() throws SQLException, RemoteException;
	public boolean supportsSubqueriesInQuantifieds() throws SQLException, RemoteException;
	public boolean supportsTableCorrelationNames() throws SQLException, RemoteException;
	public boolean supportsTransactionIsolationLevel(int level) throws SQLException, RemoteException;
	public boolean supportsTransactions() throws SQLException, RemoteException;
	public boolean supportsUnion() throws SQLException, RemoteException;
	public boolean supportsUnionAll() throws SQLException, RemoteException;
	public boolean updatesAreDetected(int type) throws SQLException, RemoteException;
	public boolean usesLocalFilePerTable() throws SQLException, RemoteException;
	public boolean usesLocalFiles() throws SQLException, RemoteException;
	public RowIdLifetime getRowIdLifetime() throws SQLException, RemoteException;
	public IResultSet getSchemas(String catalog, String schemaPattern) throws SQLException, RemoteException;
	public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException, RemoteException;
	public boolean autoCommitFailureClosesAllResultSets() throws SQLException, RemoteException;
	public IResultSet getClientInfoProperties() throws SQLException, RemoteException;
	public IResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException, RemoteException;
	public IResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException, RemoteException;
}
 public interface IPreparedStatement extends IStatement {

	public void addBatch() throws SQLException, RemoteException;
	public void clearParameters() throws SQLException, RemoteException;
	public boolean execute() throws SQLException, RemoteException;
	public IResultSet executeQuery() throws SQLException, RemoteException;
	public int executeUpdate() throws SQLException, RemoteException;
	public IResultSetMetaData getMetaData() throws SQLException, RemoteException;
	public IParameterMetaData getParameterMetaData() throws SQLException, RemoteException;
	public void setArray(int parameterIndex, SArray theArray) throws SQLException, RemoteException;
	public void setAsciiStream(int parameterIndex, SInputStream theInputStream, int length) throws SQLException, RemoteException;
	public void setBigDecimal(int parameterIndex, BigDecimal theBigDecimal) throws SQLException, RemoteException;
	public void setBinaryStream(int parameterIndex, SInputStream theInputStream, int length) throws SQLException, RemoteException;
	public void setBlob(int parameterIndex, SBlob theBlob) throws SQLException, RemoteException;
	public void setBoolean(int parameterIndex, boolean theBoolean) throws SQLException, RemoteException;
	public void setByte(int parameterIndex, byte theByte) throws SQLException, RemoteException;
	public void setBytes(int parameterIndex, byte[] theBytes) throws SQLException, RemoteException;
	public void setCharacterStream(int parameterIndex, SReader reader, int length) throws SQLException, RemoteException;
	public void setClob(int parameterIndex, SClob theClob) throws SQLException, RemoteException;
	public void setDate(int parameterIndex, Date theDate) throws SQLException, RemoteException;
	public void setDate(int parameterIndex, Date theDate, Calendar cal) throws SQLException, RemoteException;
	public void setDouble(int parameterIndex, double theDouble) throws SQLException, RemoteException;
	public void setFloat(int parameterIndex, float theFloat) throws SQLException, RemoteException;
	public void setInt(int parameterIndex, int theInt) throws SQLException, RemoteException;
	public void setLong(int parameterIndex, long theLong) throws SQLException, RemoteException;
	public void setNull(int parameterIndex, int sqlType) throws SQLException, RemoteException;
	public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException, RemoteException;
	public void setObject(int parameterIndex, Object theObject) throws SQLException, RemoteException;
	public void setObject(int parameterIndex, Object theObject, int targetSqlType) throws SQLException, RemoteException;
	public void setObject(int parameterIndex, Object theObject, int targetSqlType, int scale) throws SQLException, RemoteException;
	public void setRef(int parameterIndex, SRef theRef) throws SQLException, RemoteException;
	public void setShort(int parameterIndex, short theShort) throws SQLException, RemoteException;
	public void setString(int parameterIndex, String theString) throws SQLException, RemoteException;
	public void setTime(int parameterIndex, Time theTime) throws SQLException, RemoteException;
	public void setTime(int parameterIndex, Time theTime, Calendar cal) throws SQLException, RemoteException;
	public void setTimestamp(int parameterIndex, Timestamp theTimestamp) throws SQLException, RemoteException;
	public void setTimestamp(int parameterIndex, Timestamp theTimestamp, Calendar cal) throws SQLException, RemoteException;
	public void setUnicodeStream(int parameterIndex, SInputStream theInputStream, int length) throws SQLException, RemoteException;
	public void setURL(int parameterIndex, URL theURL) throws SQLException, RemoteException;
	public void setRowId(int parameterIndex, SRowId x) throws SQLException, RemoteException;
	public void setNString(int parameterIndex, String value) throws SQLException, RemoteException;
	public void setNCharacterStream(int parameterIndex, SReader value, long length) throws SQLException, RemoteException;
	public void setNClob(int parameterIndex, SNClob value) throws SQLException, RemoteException;
	public void setClob(int parameterIndex, SReader reader, long length) throws SQLException, RemoteException;
	public void setBlob(int parameterIndex, SInputStream inputStream, long length) throws SQLException, RemoteException;
	public void setNClob(int parameterIndex, SReader reader, long length) throws SQLException, RemoteException;
	public void setSQLXML(int parameterIndex, SSQLXML xmlObject) throws SQLException, RemoteException;
	public void setAsciiStream(int parameterIndex, SInputStream x, long length) throws SQLException, RemoteException;
	public void setBinaryStream(int parameterIndex, SInputStream x, long length) throws SQLException, RemoteException;
	public void setCharacterStream(int parameterIndex, SReader reader, long length) throws SQLException, RemoteException;
	public void setAsciiStream(int parameterIndex, SInputStream x) throws SQLException, RemoteException;
	public void setBinaryStream(int parameterIndex, SInputStream x) throws SQLException, RemoteException;
	public void setCharacterStream(int parameterIndex, SReader reader) throws SQLException, RemoteException;
	public void setNCharacterStream(int parameterIndex, SReader value) throws SQLException, RemoteException;
	public void setClob(int parameterIndex, SReader reader) throws SQLException, RemoteException;
	public void setBlob(int parameterIndex, SInputStream inputStream) throws SQLException, RemoteException;
	public void setNClob(int parameterIndex, SReader reader) throws SQLException, RemoteException;
}
 public interface IStatement extends IRemoteObject {

	public void addBatch(String sql) throws SQLException, RemoteException;
	public void cancel() throws SQLException, RemoteException;
	public void clearBatch() throws SQLException, RemoteException;
	public void clearWarnings() throws SQLException, RemoteException;
	public void close() throws SQLException, RemoteException;
	public boolean execute(String sql) throws SQLException, RemoteException;
	public boolean execute(String sql, int autoGeneratedKeys) throws SQLException, RemoteException;
	public boolean execute(String sql, int[] columnIndexes) throws SQLException, RemoteException;
	public boolean execute(String sql, String[] columnNames) throws SQLException, RemoteException;
	public int[] executeBatch() throws SQLException, RemoteException;
	public IResultSet executeQuery(String sql) throws SQLException, RemoteException;
	public int executeUpdate(String sql) throws SQLException, RemoteException;
	public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException, RemoteException;
	public int executeUpdate(String sql, int[] columnIndexes) throws SQLException, RemoteException;
	public int executeUpdate(String sql, String[] columnNames) throws SQLException, RemoteException;
	public int getFetchDirection() throws SQLException, RemoteException;
	public int getFetchSize() throws SQLException, RemoteException;
	public IResultSet getGeneratedKeys() throws SQLException, RemoteException;
	public int getMaxFieldSize() throws SQLException, RemoteException;
	public int getMaxRows() throws SQLException, RemoteException;
	public boolean getMoreResults() throws SQLException, RemoteException;
	public boolean getMoreResults(int current) throws SQLException, RemoteException;
	public int getQueryTimeout() throws SQLException, RemoteException;
	public IResultSet getResultSet() throws SQLException, RemoteException;
	public int getResultSetConcurrency() throws SQLException, RemoteException;
	public int getResultSetHoldability() throws SQLException, RemoteException;
	public int getResultSetType() throws SQLException, RemoteException;
	public int getUpdateCount() throws SQLException, RemoteException;
	public SQLWarning getWarnings() throws SQLException, RemoteException;
	public void setCursorName(String name) throws SQLException, RemoteException;
	public void setEscapeProcessing(boolean enable) throws SQLException, RemoteException;
	public void setFetchDirection(int direction) throws SQLException, RemoteException;
	public void setFetchSize(int rows) throws SQLException, RemoteException;
	public void setMaxFieldSize(int max) throws SQLException, RemoteException;
	public void setMaxRows(int max) throws SQLException, RemoteException;
	public void setQueryTimeout(int seconds) throws SQLException, RemoteException;
	public boolean isClosed() throws SQLException, RemoteException;
	public void setPoolable(boolean poolable) throws SQLException, RemoteException;
	public boolean isPoolable() throws SQLException, RemoteException;
}
 public class SArray extends SerializableObject implements Array {

	private static final long serialVersionUID = 1L;

	public static SArray create(Array w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SArray) {
			return (SArray)w;
		}
		throw new IllegalStateException();
	}
	
	public SArray() {
		throw notImplementedException();
	}

	public Object getArray() throws SQLException {
		throw notImplementedException();
	}

	public Object getArray(long index, int count) throws SQLException {
		throw notImplementedException();
	}

	public Object getArray(long index, int count, Map<String, Class<?>> map) throws SQLException {
		throw notImplementedException();
	}

	public Object getArray(Map<String, Class<?>> map) throws SQLException {
		throw notImplementedException();
	}

	public int getBaseType() throws SQLException {
		throw notImplementedException();
	}

	public String getBaseTypeName() throws SQLException {
		throw notImplementedException();
	}

	public ResultSet getResultSet() throws SQLException {
		throw notImplementedException();
	}

	public ResultSet getResultSet(long index, int count) throws SQLException {
		throw notImplementedException();
	}

	public ResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws SQLException {
		throw notImplementedException();
	}

	public ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
		throw notImplementedException();
	}

	public void free() throws SQLException {
		throw notImplementedException();
	}	
}
 public class SBlob extends SerializableObject implements Blob {

	private static final long serialVersionUID = 1L;

	public static SBlob create(Blob w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SBlob) {
			return (SBlob)w;
		}
		throw new IllegalStateException();
	}
	
	public SBlob() {
		throw notImplementedException();
	}

	public InputStream getBinaryStream() throws SQLException {
		throw notImplementedException();
	}

	public byte[] getBytes(long pos, int length) throws SQLException {
		throw notImplementedException();
	}

	public long length() throws SQLException {
		throw notImplementedException();
	}

	public long position(Blob pattern, long start) throws SQLException {
		throw notImplementedException();
	}

	public long position(byte[] pattern, long start) throws SQLException {
		throw notImplementedException();
	}

	public OutputStream setBinaryStream(long pos) throws SQLException {
		throw notImplementedException();
	}

	public int setBytes(long pos, byte[] theBytes) throws SQLException {
		throw notImplementedException();
	}

	public int setBytes(long pos, byte[] theBytes, int offset, int len) throws SQLException {
		throw notImplementedException();
	}

	public void truncate(long len) throws SQLException {
		throw notImplementedException();
	}

	public void free() throws SQLException {
		throw notImplementedException();
	}

	public InputStream getBinaryStream(long pos, long length) throws SQLException {
		throw notImplementedException();
	}
}
 public class SClob extends SerializableObject implements Clob {

	private static final long serialVersionUID = 1L;

	public static SClob create(Clob w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SClob) {
			return (SClob)w;
		}
		throw new IllegalStateException();
	}
	
	public SClob() {
		throw notImplementedException();
	}

	public InputStream getAsciiStream() throws SQLException {
		throw notImplementedException();
	}

	public Reader getCharacterStream() throws SQLException {
		throw notImplementedException();
	}

	public String getSubString(long pos, int length) throws SQLException {
		throw notImplementedException();
	}

	public long length() throws SQLException {
		throw notImplementedException();
	}

	public long position(Clob searchstr, long start) throws SQLException {
		throw notImplementedException();
	}

	public long position(String searchstr, long start) throws SQLException {
		throw notImplementedException();
	}

	public OutputStream setAsciiStream(long pos) throws SQLException {
		throw notImplementedException();
	}

	public Writer setCharacterStream(long pos) throws SQLException {
		throw notImplementedException();
	}

	public int setString(long pos, String str) throws SQLException {
		throw notImplementedException();
	}

	public int setString(long pos, String str, int offset, int len) throws SQLException {
		throw notImplementedException();
	}

	public void truncate(long len) throws SQLException {
		throw notImplementedException();
	}

	public void free() throws SQLException {
		throw notImplementedException();
	}

	public Reader getCharacterStream(long pos, long length) throws SQLException {
		throw notImplementedException();
	}	
}
 public class SNClob extends SClob implements NClob {
	
	private static final long serialVersionUID = 1L;

	public static SNClob create(NClob w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SNClob) {
			return (SNClob)w;
		}
		throw new IllegalStateException();
	}

	public SNClob() {
		throw notImplementedException();
	}
}
 public class SSQLXML extends SerializableObject implements SQLXML {

	private static final long serialVersionUID = 1L;
	
	public static SSQLXML create(SQLXML w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SSQLXML) {
			return (SSQLXML)w;
		}
		throw new IllegalStateException();
	}

	public SSQLXML() {
		throw notImplementedException();
	}
	
	public void free() throws SQLException {
		throw notImplementedException();
	}

	public InputStream getBinaryStream() throws SQLException {
		throw notImplementedException();
	}

	public OutputStream setBinaryStream() throws SQLException {
		throw notImplementedException();
	}

	public Reader getCharacterStream() throws SQLException {
		throw notImplementedException();
	}

	public Writer setCharacterStream() throws SQLException {
		throw notImplementedException();
	}

	public String getString() throws SQLException {
		throw notImplementedException();
	}

	public void setString(String value) throws SQLException {
		throw notImplementedException();
	}

	public <T extends Source> T getSource(Class<T> sourceClass) throws SQLException {
		throw notImplementedException();
	}

	public <T extends Result> T setResult(Class<T> resultClass) throws SQLException {
		throw notImplementedException();
	}

}
 public class SSavepoint extends SerializableObject implements Savepoint {

	private static final long serialVersionUID = 1L;

	public static SSavepoint create(Savepoint w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SSavepoint) {
			return (SSavepoint)w;
		}
		throw new IllegalStateException();
	}
	
	public SSavepoint() {
		throw notImplementedException();
	}
	
	public int getSavepointId() throws SQLException {
		throw notImplementedException();
	}

	public String getSavepointName() throws SQLException {
		throw notImplementedException();
	}
}
 public class SStruct extends SerializableObject implements Struct {

	private static final long serialVersionUID = 1L;

	public static SStruct create(Struct w) {
		if(w==null) {
			return null;
		}
		if(w instanceof SStruct) {
			return (SStruct)w;
		}
		throw new IllegalStateException();
	}
	
	public SStruct() {
		throw notImplementedException();
	}

	public String getSQLTypeName() throws SQLException {
		throw notImplementedException();
	}

	public Object[] getAttributes() throws SQLException {
		throw notImplementedException();
	}

	public Object[] getAttributes(Map<String, Class<?>> theMap) throws SQLException {
		throw notImplementedException();
	}
}
 public abstract class Context {
	
    private static ContextFinder contextFinder;

    public static abstract class ContextFinder {
    	ContextFinder next;
    	protected ContextFinder(ContextFinder next) {
    		this.next = next;
    	}
        public abstract Context find();
    }

    public static ContextFinder getContextFinder() {
        return contextFinder;
    }

    public static void setContextFinder(ContextFinder contextFinder) {
        Context.contextFinder=contextFinder;
    }
    
    
    private static ThreadLocal<Context> contexts = new ThreadLocal<Context>();
    
    public static Context get() {
        Context c = contexts.get();
        if(c!=null) {
            return c;
        }
        for(ContextFinder f=contextFinder; f!=null; f=f.next) {
        	c = f.find();
        	if(c!=null) {
        		return c;
        	}
        }
        throw new IllegalStateException("No current DomSQL context set");
    }

    public static void push(Context context) {
        contexts.set(context);
    }
    
    public static void pop() {
        contexts.remove();
    }
    
    private HashMap<String, Long> handles = new HashMap<String, Long>();
    
    public Context() {
    }

    public synchronized void close() {
        for(Long hDb: handles.values()) {
            try {
                if(shouldClose(hDb)) {
                    NotesAPI.NSFDBClose(hDb);
                }
            } catch(SQLException ex) {
                ex.printStackTrace();
            }
        }
    }
    protected boolean shouldClose(long hDb) {
        return true;
    }
    
    public long getDBHandle(String path) throws SQLException {
        if(path==null) path = "";
        Long l = handles.get(path);
        if(l!=null) {
            return l;
        }
        long h = path.length()==0 ? getDefaultDBHandle() : openDBHandle(path);
        handles.put(path, h);
        return h;
    }
    
    protected long openDBHandle(String path) throws SQLException {
        return NotesAPI.NSFDBOpen(path);
    }

    protected long getDefaultDBHandle() throws SQLException {
        throw DomSQLException.create(null, "No default database handle available");
    }
}
 public class DomSQLConnection extends DomSQLObject implements Connection {
	
    private Database db;
    private String userName;

    private DomSQLDatabaseMetaData meta;
    private boolean autoCommit = true;
    private int timeout;

    // Indicates if a transaction was started while not in auto-commit mode
    private boolean transactionStarted;

    // List of statements related to this connections
    private List<DomSQLStatement> statements = new ArrayList<DomSQLStatement>();
    

    public DomSQLConnection(Database db) throws SQLException {
        this.db = db;
        db.addConnection(this);
    }

    protected DomSQLConnection getConnection() {
        return this;
    }
    
    public String getUserName() {
        return userName;
    }

    public void close() throws SQLException {
        if(db!=null) {
            synchronized(this) {
                if(db!=null) {
                    closeMetaData();
                    closeStatements();
                    transactionStarted = false;
                    db.removeConnection(this);
                    db = null;
                }
            }
        }
    }
    
    public void removeStatement(DomSQLStatement statement) {
        statements.remove(statement);
    }

    private void closeMetaData() throws SQLException {
        if(meta!=null) {
            meta.close();
        }
    }
    private void closeStatements() throws SQLException {
        for(DomSQLStatement stmt:statements ) {
            stmt.release();
        }
        statements.clear();
    }

    public boolean isClosed() throws SQLException {
        return db==null;
    }
    
    public Database getDatabase() {
        return db;
    }
    
    public long getSqliteDb() {
        return db.getSqliteDb();
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int ms) throws SQLException {
        this.timeout = ms;
        SQLite.busyTimeout(getSqliteDb(),ms);
    }

    public String getUrl() {
        return db.getUrl();
    }

    private void checkConnectionOpen() throws SQLException {
        if(db==null) {
            throw DomSQLException.create(null,"The connection is closed");
        }
    }

    private void checkCursorOptions(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException {
    	// We relax the constraint on the cursor type so a caller can use relative() methods 
        //if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) {
        //    throw DomSQLException.create(null,"DomSQL cursors only supports TYPE_FORWARD_ONLY option");
        //}
        if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
            throw DomSQLException.create(null,"DomSQL cursors only supports CONCUR_READ_ONLY option");
        }
        if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
            throw DomSQLException.create(null,"DomSQL cursors only supports CLOSE_CURSORS_AT_COMMIT option");
        }
    }

    public String getCatalog() throws SQLException {
        checkConnectionOpen();
        return null;
    }

    public void setCatalog(String catalog) throws SQLException {
        checkConnectionOpen();
    }

    public int getHoldability() throws SQLException {
        checkConnectionOpen();
        return ResultSet.CLOSE_CURSORS_AT_COMMIT;
    }

    public void setHoldability(int holdability) throws SQLException {
        checkConnectionOpen();
        if (holdability != ResultSet.CLOSE_CURSORS_AT_COMMIT) {
            throw DomSQLException.create(null,"DomSQL cursors only supports CLOSE_CURSORS_AT_COMMIT option");
        }
    }

    public int getTransactionIsolation() {
        return TRANSACTION_SERIALIZABLE;
    }

    public void setTransactionIsolation(int level) throws SQLException {
        if (level != TRANSACTION_SERIALIZABLE) {
            throw DomSQLException.create(null,"DomSQL only supports TRANSACTION_SERIALIZABLE");
        }
    }

    public Map getTypeMap() throws SQLException {
        throw new NotImplementedException();
    }

    public void setTypeMap(Map map) throws SQLException {
        throw new NotImplementedException();
    }

    public boolean isReadOnly() throws SQLException {
        return false;
    }

    public void setReadOnly(boolean ro) throws SQLException {
    }

    public DomSQLDatabaseMetaData getMetaData() {
        if (meta == null) {
            meta = new DomSQLDatabaseMetaData(this);
        }
        return meta;
    }

    public String nativeSQL(String sql) {
        return sql;
    }

    public void clearWarnings() throws SQLException {
    }

    public SQLWarning getWarnings() throws SQLException {
        return null;
    }

    public boolean getAutoCommit() throws SQLException {
        return autoCommit;
    }

    public void setAutoCommit(boolean autoCommit) throws SQLException {
        if(this.autoCommit!=autoCommit) {
            if(transactionStarted) {
                rollback();
            }
            this.autoCommit = autoCommit;
        }
    }
    
    public void ensureTransactionStarted() throws SQLException {
        if(autoCommit) {
            return;
        }
        if(!transactionStarted) {
            exec("BEGIN TRANSACTION");
            transactionStarted = true;
        }
    }

    public void commit() throws SQLException {
        if(transactionStarted) {
            exec("COMMIT");
            transactionStarted = false;
        }
    }

    public void rollback() throws SQLException {
        if(transactionStarted) {
            exec("ROLLBACK");
            transactionStarted = false;
        }
    }

    public DomSQLStatement createStatement() throws SQLException {
        return createStatement(ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT);
    }

    public DomSQLStatement createStatement(int resultSetType, int resultSetConcurrency)
            throws SQLException {
        return createStatement(resultSetType, resultSetConcurrency,
                ResultSet.CLOSE_CURSORS_AT_COMMIT);
    }

    public DomSQLStatement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
            throws SQLException {
        checkCursorOptions(resultSetType, resultSetConcurrency, resultSetHoldability);
        DomSQLStatement st = new DomSQLStatement(this);
        statements.add(st);
        if(DomSQL.debug.TRACE_JAVA_SQL) {
            JNIUtils.trace("Connection {0}, Create Statement {1}",getObjectId(),st.getObjectId());
        }
        return st;
    }

    public DomSQLCallableStatement prepareCall(String sql) throws SQLException {
        return prepareCall(sql, ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT);
    }

    public DomSQLCallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency)
            throws SQLException {
        return prepareCall(sql, resultSetType, resultSetConcurrency, ResultSet.CLOSE_CURSORS_AT_COMMIT);
    }

    public DomSQLCallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)
            throws SQLException {
        throw new SQLException("DomSQL does not support Stored Procedures");
    }

    public DomSQLPreparedStatement prepareStatement(String sql) throws SQLException {
        return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY,
                ResultSet.CONCUR_READ_ONLY);
    }

    public DomSQLPreparedStatement prepareStatement(String sql, int autoCommit)
            throws SQLException {
        throw new NotImplementedException();
    }

    public DomSQLPreparedStatement prepareStatement(String sql, int[] colIndexes)
            throws SQLException {
        throw new NotImplementedException();
    }

    public DomSQLPreparedStatement prepareStatement(String sql, String[] colNames)
            throws SQLException {
        throw new NotImplementedException();
    }

    public DomSQLPreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
            throws SQLException {
        return prepareStatement(sql, resultSetType, resultSetConcurrency,
                ResultSet.CLOSE_CURSORS_AT_COMMIT);
    }

    public DomSQLPreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
            int resultSetHoldability) throws SQLException {
        checkCursorOptions(resultSetType, resultSetConcurrency, resultSetHoldability);
        DomSQLPreparedStatement st = new DomSQLPreparedStatement(this, sql);
        if(DomSQL.debug.TRACE_JAVA_SQL) {
            JNIUtils.trace("Connection {0}, Prepare Statement {1}, SQL {2}",getObjectId(),st.getObjectId(),sql);
        }
        return st;
    }


    // UNUSED FUNCTIONS /////////////////////////////////////////////

    public Savepoint setSavepoint() throws SQLException {
        throw new NotImplementedException();
    }

    public Savepoint setSavepoint(String name) throws SQLException {
        throw new NotImplementedException();
    }

    public void releaseSavepoint(Savepoint savepoint) throws SQLException {
        throw new NotImplementedException();
    }

    public void rollback(Savepoint savepoint) throws SQLException {
        throw new NotImplementedException();
    }

    public Struct createStruct(String typeName, Object[] attributes) throws SQLException {
        throw new NotImplementedException();
    }

    // JRE 1.5 //////////////////////////////////////////////////////

    //@Override
    public Array createArrayOf(String typeName, Object[] elements)
            throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public Blob createBlob() throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public Clob createClob() throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public NClob createNClob() throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public SQLXML createSQLXML() throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public Properties getClientInfo() throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public String getClientInfo(String name) throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public boolean isValid(int timeout) throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public void setClientInfo(Properties properties)
            throws SQLClientInfoException {
        throw new NotImplementedException();
    }

    //@Override
    public void setClientInfo(String name, String value)
            throws SQLClientInfoException {
        throw new NotImplementedException();
    }

    //@Override
    public boolean isWrapperFor(Class<?> iface) throws SQLException {
        throw new NotImplementedException();
    }

    //@Override
    public <T> T unwrap(Class<T> iface) throws SQLException {
        throw new NotImplementedException();
    }
    
    
    // Similar to sqlite3_exec
    // "The sqlite3_exec() interface is a convenience wrapper around sqlite3_prepare_v2(), 
    // sqlite3_step(), and sqlite3_finalize(), that allows an application to run multiple 
    // statements of SQL without having to use a lot of C code."    
    private void exec(String sql) throws SQLException {
        // Update the last access timestamp
    	updateLastAccess();
        if(DomSQL.debug.TRACE_JAVA_SQL) {
            JNIUtils.trace("exec(sql): {0}",sql);
        }
        long hstmt = SQLite.prepare(getSqliteDb(),sql);
        try {
            int code = SQLite.step(hstmt);
            switch (code) {
                case SQLite.SQLITE_DONE:
                case SQLite.SQLITE_ROW:
                        return;
            }
            throwex(code);
        } finally {
            SQLite.finalize(hstmt);
        }
    }
}

import java.lang.Thread.UncaughtExceptionHandler;
import java.rmi.RemoteException;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.util.Map;
import java.util.Properties;
import com.ibm.domino.domsql.remote.transport.ICallableStatement;
import com.ibm.domino.domsql.remote.transport.IConnection;
import com.ibm.domino.domsql.remote.transport.IDatabaseMetaData;
import com.ibm.domino.domsql.remote.transport.IPreparedStatement;
import com.ibm.domino.domsql.remote.transport.IStatement;
import com.ibm.domino.domsql.remote.transport.SArray;
import com.ibm.domino.domsql.remote.transport.SBlob;
import com.ibm.domino.domsql.remote.transport.SClob;
import com.ibm.domino.domsql.remote.transport.SNClob;
import com.ibm.domino.domsql.remote.transport.SSQLXML;
import com.ibm.domino.domsql.remote.transport.SSavepoint;
import com.ibm.domino.domsql.remote.transport.SStruct;
import com.ibm.domino.domsql.sqlite.driver.Context;
import com.ibm.domino.domsql.sqlite.driver.jdbc.DomSQLConnection;
import com.ibm.dots.session.SessionContext;

    	this.returnValue = returnValue;
    }
    
    public UncaughtExceptionHandler getOldUncaughtExceptionHandler() {
    	return oldExceptionHandler;
    }
    
    public void setOldUncaughtExceptionHandler(UncaughtExceptionHandler oldExceptionHandler) {
    	this.oldExceptionHandler = oldExceptionHandler;
    }
    
    
    // ===========================================================
    // Base methods
    // ===========================================================

    public <T> T unwrap(Class<T> iface) throws SQLException, RemoteException {
        return localConnection.unwrap(iface);
    }

    public boolean isWrapperFor(Class<?> iface) throws SQLException, RemoteException {
        return localConnection.isWrapperFor(iface);
    }

    
    // ===========================================================
    // Delegation
    // ===========================================================
    
    public void clearWarnings() throws SQLException, RemoteException {
        initContext();
        try {
            localConnection.clearWarnings();
        } finally {
            termContext();
        }
    }

    public void close() throws SQLException, RemoteException {
        try {
            initContext();
            try {
                localConnection.close();
                context.close();
            } finally {
                termContext();
            }
        } finally {
            termConnection();
        }
    }

    public void commit() throws SQLException, RemoteException {
        initContext();
        try {
            localConnection.commit();
        } finally {
            termContext();
        }
    }

    public IStatement createStatement() throws SQLException, RemoteException {
        initContext();
        try {
            return wrap(localConnection.createStatement());
        } finally {
            termContext();
        }
    }

    public IStatement createStatement(int resultSetType, int resultSetConcurrency)
            throws SQLException, RemoteException {
        initContext();
        try {
            return wrap(localConnection.createStatement(resultSetType,
                    resultSetConcurrency));
        } finally {
            termContext();
        }
    }

    public IStatement createStatement(int resultSetType,
            int resultSetConcurrency, int resultSetHoldability)
            throws SQLException, RemoteException {
        initContext();
        try {
            return wrap(localConnection.createStatement(resultSetType,
                    resultSetConcurrency, resultSetHoldability));
        } finally {
            termContext();
        }
    }

    public boolean getAutoCommit() throws SQLException, RemoteException {
        initContext();
        try {
            return wrap(localConnection.getAutoCommit());
        } finally {
            termContext();
        }
    }

    public String getCatalog() throws SQLException, RemoteException {
        initContext();
        try {
            return wrap(localConnection.getCatalog());
        } finally {
            termContext();
        }
    }

    public int getHoldability() throws SQLException, RemoteException {
        initContext();
        try {
            return wrap(localConnection.getHoldability());
        } finally {
            termContext();
        }
    }


    public IDatabaseMetaData getMetaData() throws SQLException, RemoteException {
