001: /*
002:
003: This software is OSI Certified Open Source Software.
004: OSI Certified is a certification mark of the Open Source Initiative.
005:
006: The license (Mozilla version 1.0) can be read at the MMBase site.
007: See http://www.MMBase.org/license
008:
009: */
010: package org.mmbase.module.database;
011:
012: import java.sql.*;
013: import java.util.*;
014:
015: /**
016: * MMBase wraps java.sql.Connection. This interface is more or less that plus java.sql.Connection of
017: * java 1.5. (See also MMB-1409).
018: *
019: */
020: public interface MultiConnection {
021:
022: public void setLastSQL(String sql);
023:
024: public String getLastSQL();
025:
026: public Exception getStackTrace();
027:
028: public String getStateString();
029:
030: public void resetUsage();
031:
032: public void claim();
033:
034: public MultiPool getParent();
035:
036: public Statement createStatement() throws SQLException;
037:
038: public Statement createStatement(int resultSetType,
039: int resultSetConcurrency) throws SQLException;
040:
041: public Statement createStatement(int type, int concurrency,
042: int holdability) throws SQLException;
043:
044: public PreparedStatement prepareStatement(String sql)
045: throws SQLException;
046:
047: public PreparedStatement prepareStatement(String sql,
048: int autoGeneratedKeys) throws SQLException;
049:
050: public PreparedStatement prepareStatement(String sql,
051: int[] columnIndexes) throws SQLException;
052:
053: public PreparedStatement prepareStatement(String sql,
054: String[] columnNames) throws SQLException;
055:
056: public PreparedStatement prepareStatement(String sql, int type,
057: int concurrency, int holdability) throws SQLException;
058:
059: public CallableStatement prepareCall(String sql)
060: throws SQLException;
061:
062: public String nativeSQL(String query) throws SQLException;
063:
064: public void setAutoCommit(boolean enableAutoCommit)
065: throws SQLException;
066:
067: public boolean getAutoCommit() throws SQLException;
068:
069: public void commit() throws SQLException;
070:
071: public void rollback() throws SQLException;
072:
073: public void close() throws SQLException;
074:
075: public boolean isClosed() throws SQLException;
076:
077: public DatabaseMetaData getMetaData() throws SQLException;
078:
079: public void setReadOnly(boolean readOnly) throws SQLException;
080:
081: public boolean isReadOnly() throws SQLException;
082:
083: public void setCatalog(String catalog) throws SQLException;
084:
085: public String getCatalog() throws SQLException;
086:
087: public void setTransactionIsolation(int level) throws SQLException;
088:
089: public int getTransactionIsolation() throws SQLException;
090:
091: public SQLWarning getWarnings() throws SQLException;
092:
093: public void clearWarnings() throws SQLException;
094:
095: public CallableStatement prepareCall(String sql, int i, int y)
096: throws SQLException;
097:
098: public void setTypeMap(Map mp) throws SQLException;
099:
100: public Map getTypeMap() throws SQLException;
101:
102: public PreparedStatement prepareStatement(String sql, int i, int y)
103: throws SQLException;
104:
105: public void setHoldability(int holdability) throws SQLException;
106:
107: public int getHoldability() throws SQLException;
108:
109: public Savepoint setSavepoint() throws SQLException;
110:
111: public Savepoint setSavepoint(String name) throws SQLException;
112:
113: public void rollback(Savepoint savepoint) throws SQLException;
114:
115: public void releaseSavepoint(Savepoint savepoint)
116: throws SQLException;
117:
118: public CallableStatement prepareCall(String sql, int type,
119: int concurrency, int holdability) throws SQLException;
120:
121: public boolean checkAfterException() throws SQLException;
122:
123: public void realclose() throws SQLException;
124:
125: public void release();
126:
127: public int getUsage();
128:
129: public int getStartTime();
130:
131: public long getStartTimeMillis();
132:
133: public <T> T unwrap(Class<T> iface);
134:
135: public void wrap(Connection con);
136:
137: }
|