Skip to content

Commit

Permalink
rename getNextId to getNextTraceId
Browse files Browse the repository at this point in the history
  • Loading branch information
codefollower committed Mar 19, 2016
1 parent 47eba42 commit c488c01
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 41 deletions.
Expand Up @@ -61,15 +61,13 @@
* @author H2 Group * @author H2 Group
* @author zhh * @author zhh
*/ */
// 只支持Java 1.7中的JDBC API
public class JdbcConnection extends TraceObject implements Connection { public class JdbcConnection extends TraceObject implements Connection {


private static boolean keepOpenStackTrace; private static boolean keepOpenStackTrace;
private final String url; private final String url;
private final String user; private final String user;


// ResultSet.HOLD_CURSORS_OVER_COMMIT private int holdability = ResultSet.HOLD_CURSORS_OVER_COMMIT;
private int holdability = 1;


private Session session; private Session session;
private Command commit, rollback; private Command commit, rollback;
Expand Down Expand Up @@ -100,7 +98,7 @@ public JdbcConnection(String url, Properties info) throws SQLException {
// this will return an embedded or server connection // this will return an embedded or server connection
session = new ClientSession(ci).connectEmbeddedOrServer(); session = new ClientSession(ci).connectEmbeddedOrServer();
trace = session.getTrace(); trace = session.getTrace();
int id = getNextId(TraceObject.CONNECTION); int id = getNextTraceId(TraceObject.CONNECTION);
setTrace(trace, TraceObject.CONNECTION, id); setTrace(trace, TraceObject.CONNECTION, id);
user = ci.getUserName(); user = ci.getUserName();
url = ci.getURL(); // 不含参数 url = ci.getURL(); // 不含参数
Expand All @@ -123,7 +121,7 @@ public JdbcConnection(String url, Properties info) throws SQLException {
public JdbcConnection(Session session, String user, String url) { public JdbcConnection(Session session, String user, String url) {
this.session = session; this.session = session;
trace = session.getTrace(); trace = session.getTrace();
int id = getNextId(TraceObject.CONNECTION); int id = getNextTraceId(TraceObject.CONNECTION);
setTrace(trace, TraceObject.CONNECTION, id); setTrace(trace, TraceObject.CONNECTION, id);
this.user = user; this.user = user;
this.url = url; this.url = url;
Expand Down Expand Up @@ -159,7 +157,7 @@ private void closeOld() {
@Override @Override
public Statement createStatement() throws SQLException { public Statement createStatement() throws SQLException {
try { try {
int id = getNextId(TraceObject.STATEMENT); int id = getNextTraceId(TraceObject.STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("Statement", TraceObject.STATEMENT, id, "createStatement()"); debugCodeAssign("Statement", TraceObject.STATEMENT, id, "createStatement()");
} }
Expand All @@ -184,7 +182,7 @@ public Statement createStatement() throws SQLException {
@Override @Override
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
try { try {
int id = getNextId(TraceObject.STATEMENT); int id = getNextTraceId(TraceObject.STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("Statement", TraceObject.STATEMENT, id, "createStatement(" + resultSetType + ", " debugCodeAssign("Statement", TraceObject.STATEMENT, id, "createStatement(" + resultSetType + ", "
+ resultSetConcurrency + ")"); + resultSetConcurrency + ")");
Expand Down Expand Up @@ -212,7 +210,7 @@ public Statement createStatement(int resultSetType, int resultSetConcurrency) th
public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability)
throws SQLException { throws SQLException {
try { try {
int id = getNextId(TraceObject.STATEMENT); int id = getNextTraceId(TraceObject.STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("Statement", TraceObject.STATEMENT, id, "createStatement(" + resultSetType + ", " debugCodeAssign("Statement", TraceObject.STATEMENT, id, "createStatement(" + resultSetType + ", "
+ resultSetConcurrency + ", " + resultSetHoldability + ")"); + resultSetConcurrency + ", " + resultSetHoldability + ")");
Expand All @@ -236,7 +234,7 @@ public Statement createStatement(int resultSetType, int resultSetConcurrency, in
@Override @Override
public PreparedStatement prepareStatement(String sql) throws SQLException { public PreparedStatement prepareStatement(String sql) throws SQLException {
try { try {
int id = getNextId(TraceObject.PREPARED_STATEMENT); int id = getNextTraceId(TraceObject.PREPARED_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement(" debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement("
+ quote(sql) + ")"); + quote(sql) + ")");
Expand All @@ -259,7 +257,7 @@ public PreparedStatement prepareStatement(String sql) throws SQLException {
*/ */
PreparedStatement prepareAutoCloseStatement(String sql) throws SQLException { PreparedStatement prepareAutoCloseStatement(String sql) throws SQLException {
try { try {
int id = getNextId(TraceObject.PREPARED_STATEMENT); int id = getNextTraceId(TraceObject.PREPARED_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement(" debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement("
+ quote(sql) + ")"); + quote(sql) + ")");
Expand All @@ -282,7 +280,7 @@ PreparedStatement prepareAutoCloseStatement(String sql) throws SQLException {
@Override @Override
public DatabaseMetaData getMetaData() throws SQLException { public DatabaseMetaData getMetaData() throws SQLException {
try { try {
int id = getNextId(TraceObject.DATABASE_META_DATA); int id = getNextTraceId(TraceObject.DATABASE_META_DATA);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("DatabaseMetaData", TraceObject.DATABASE_META_DATA, id, "getMetaData()"); debugCodeAssign("DatabaseMetaData", TraceObject.DATABASE_META_DATA, id, "getMetaData()");
} }
Expand Down Expand Up @@ -591,7 +589,7 @@ public void clearWarnings() throws SQLException {
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
throws SQLException { throws SQLException {
try { try {
int id = getNextId(TraceObject.PREPARED_STATEMENT); int id = getNextTraceId(TraceObject.PREPARED_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement(" debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement("
+ quote(sql) + ", " + resultSetType + ", " + resultSetConcurrency + ")"); + quote(sql) + ", " + resultSetType + ", " + resultSetConcurrency + ")");
Expand Down Expand Up @@ -819,7 +817,7 @@ public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
@Override @Override
public CallableStatement prepareCall(String sql) throws SQLException { public CallableStatement prepareCall(String sql) throws SQLException {
try { try {
int id = getNextId(TraceObject.CALLABLE_STATEMENT); int id = getNextTraceId(TraceObject.CALLABLE_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("CallableStatement", TraceObject.CALLABLE_STATEMENT, id, "prepareCall(" + quote(sql) debugCodeAssign("CallableStatement", TraceObject.CALLABLE_STATEMENT, id, "prepareCall(" + quote(sql)
+ ")"); + ")");
Expand Down Expand Up @@ -848,7 +846,7 @@ public CallableStatement prepareCall(String sql) throws SQLException {
@Override @Override
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException {
try { try {
int id = getNextId(TraceObject.CALLABLE_STATEMENT); int id = getNextTraceId(TraceObject.CALLABLE_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("CallableStatement", TraceObject.CALLABLE_STATEMENT, id, "prepareCall(" + quote(sql) debugCodeAssign("CallableStatement", TraceObject.CALLABLE_STATEMENT, id, "prepareCall(" + quote(sql)
+ ", " + resultSetType + ", " + resultSetConcurrency + ")"); + ", " + resultSetType + ", " + resultSetConcurrency + ")");
Expand Down Expand Up @@ -879,7 +877,7 @@ public CallableStatement prepareCall(String sql, int resultSetType, int resultSe
public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException { int resultSetHoldability) throws SQLException {
try { try {
int id = getNextId(TraceObject.CALLABLE_STATEMENT); int id = getNextTraceId(TraceObject.CALLABLE_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("CallableStatement", TraceObject.CALLABLE_STATEMENT, id, "prepareCall(" + quote(sql) debugCodeAssign("CallableStatement", TraceObject.CALLABLE_STATEMENT, id, "prepareCall(" + quote(sql)
+ ", " + resultSetType + ", " + resultSetConcurrency + ", " + resultSetHoldability + ")"); + ", " + resultSetType + ", " + resultSetConcurrency + ", " + resultSetHoldability + ")");
Expand All @@ -902,7 +900,7 @@ public CallableStatement prepareCall(String sql, int resultSetType, int resultSe
@Override @Override
public Savepoint setSavepoint() throws SQLException { public Savepoint setSavepoint() throws SQLException {
try { try {
int id = getNextId(TraceObject.SAVEPOINT); int id = getNextTraceId(TraceObject.SAVEPOINT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint()"); debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint()");
} }
Expand All @@ -926,7 +924,7 @@ public Savepoint setSavepoint() throws SQLException {
@Override @Override
public Savepoint setSavepoint(String name) throws SQLException { public Savepoint setSavepoint(String name) throws SQLException {
try { try {
int id = getNextId(TraceObject.SAVEPOINT); int id = getNextTraceId(TraceObject.SAVEPOINT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint(" + quote(name) + ")"); debugCodeAssign("Savepoint", TraceObject.SAVEPOINT, id, "setSavepoint(" + quote(name) + ")");
} }
Expand Down Expand Up @@ -996,7 +994,7 @@ private static JdbcSavepoint convertSavepoint(Savepoint savepoint) {
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency,
int resultSetHoldability) throws SQLException { int resultSetHoldability) throws SQLException {
try { try {
int id = getNextId(TraceObject.PREPARED_STATEMENT); int id = getNextTraceId(TraceObject.PREPARED_STATEMENT);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement(" debugCodeAssign("PreparedStatement", TraceObject.PREPARED_STATEMENT, id, "prepareStatement("
+ quote(sql) + ", " + resultSetType + ", " + resultSetConcurrency + ", " + resultSetHoldability + quote(sql) + ", " + resultSetType + ", " + resultSetConcurrency + ", " + resultSetHoldability
Expand Down Expand Up @@ -1399,7 +1397,7 @@ ResultSet getGeneratedKeys(JdbcStatement stat, int id) {
@Override @Override
public Clob createClob() throws SQLException { public Clob createClob() throws SQLException {
try { try {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
debugCodeAssign("Clob", TraceObject.CLOB, id, "createClob()"); debugCodeAssign("Clob", TraceObject.CLOB, id, "createClob()");
checkClosed(); checkClosed();
Value v = session.getDataHandler().getLobStorage() Value v = session.getDataHandler().getLobStorage()
Expand All @@ -1418,7 +1416,7 @@ public Clob createClob() throws SQLException {
@Override @Override
public Blob createBlob() throws SQLException { public Blob createBlob() throws SQLException {
try { try {
int id = getNextId(TraceObject.BLOB); int id = getNextTraceId(TraceObject.BLOB);
debugCodeAssign("Blob", TraceObject.BLOB, id, "createClob()"); debugCodeAssign("Blob", TraceObject.BLOB, id, "createClob()");
checkClosed(); checkClosed();
Value v = session.getDataHandler().getLobStorage() Value v = session.getDataHandler().getLobStorage()
Expand All @@ -1438,7 +1436,7 @@ public Blob createBlob() throws SQLException {
@Override @Override
public NClob createNClob() throws SQLException { public NClob createNClob() throws SQLException {
try { try {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
debugCodeAssign("NClob", TraceObject.CLOB, id, "createNClob()"); debugCodeAssign("NClob", TraceObject.CLOB, id, "createNClob()");
checkClosed(); checkClosed();
Value v = session.getDataHandler().getLobStorage() Value v = session.getDataHandler().getLobStorage()
Expand Down Expand Up @@ -1621,12 +1619,12 @@ Object convertToDefaultObject(Value v) {
Object o; Object o;
switch (v.getType()) { switch (v.getType()) {
case Value.CLOB: { case Value.CLOB: {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
o = new JdbcClob(this, v, id); o = new JdbcClob(this, v, id);
break; break;
} }
case Value.BLOB: { case Value.BLOB: {
int id = getNextId(TraceObject.BLOB); int id = getNextTraceId(TraceObject.BLOB);
o = new JdbcBlob(this, v, id); o = new JdbcBlob(this, v, id);
break; break;
} }
Expand Down
Expand Up @@ -77,7 +77,7 @@ public class JdbcDataSource extends TraceObject implements DataSource, Serializa
*/ */
public JdbcDataSource() { public JdbcDataSource() {
initFactory(); initFactory();
int id = getNextId(TraceObject.DATA_SOURCE); int id = getNextTraceId(TraceObject.DATA_SOURCE);
setTrace(factory.getTrace(), TraceObject.DATA_SOURCE, id); setTrace(factory.getTrace(), TraceObject.DATA_SOURCE, id);
} }


Expand Down
Expand Up @@ -93,7 +93,7 @@ void setCachedColumnLabelMap(HashMap<String, Integer> cachedColumnLabelMap) {
@Override @Override
public ResultSet executeQuery() throws SQLException { public ResultSet executeQuery() throws SQLException {
try { try {
int id = getNextId(TraceObject.RESULT_SET); int id = getNextTraceId(TraceObject.RESULT_SET);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "executeQuery()"); debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "executeQuery()");
} }
Expand Down Expand Up @@ -166,7 +166,7 @@ private int executeUpdateInternal() throws SQLException {
@Override @Override
public boolean execute() throws SQLException { public boolean execute() throws SQLException {
try { try {
int id = getNextId(TraceObject.RESULT_SET); int id = getNextTraceId(TraceObject.RESULT_SET);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeCall("execute"); debugCodeCall("execute");
} }
Expand Down Expand Up @@ -1037,7 +1037,7 @@ public ResultSetMetaData getMetaData() throws SQLException {
if (result == null) { if (result == null) {
return null; return null;
} }
int id = getNextId(TraceObject.RESULT_SET_META_DATA); int id = getNextTraceId(TraceObject.RESULT_SET_META_DATA);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("ResultSetMetaData", TraceObject.RESULT_SET_META_DATA, id, "getMetaData()"); debugCodeAssign("ResultSetMetaData", TraceObject.RESULT_SET_META_DATA, id, "getMetaData()");
} }
Expand Down Expand Up @@ -1277,7 +1277,7 @@ public boolean execute(String sql, String[] columnNames) throws SQLException {
@Override @Override
public ParameterMetaData getParameterMetaData() throws SQLException { public ParameterMetaData getParameterMetaData() throws SQLException {
try { try {
int id = getNextId(TraceObject.PARAMETER_META_DATA); int id = getNextTraceId(TraceObject.PARAMETER_META_DATA);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("ParameterMetaData", TraceObject.PARAMETER_META_DATA, id, "getParameterMetaData()"); debugCodeAssign("ParameterMetaData", TraceObject.PARAMETER_META_DATA, id, "getParameterMetaData()");
} }
Expand Down
Expand Up @@ -134,7 +134,7 @@ public boolean next() throws SQLException {
@Override @Override
public ResultSetMetaData getMetaData() throws SQLException { public ResultSetMetaData getMetaData() throws SQLException {
try { try {
int id = getNextId(TraceObject.RESULT_SET_META_DATA); int id = getNextTraceId(TraceObject.RESULT_SET_META_DATA);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("ResultSetMetaData", TraceObject.RESULT_SET_META_DATA, id, "getMetaData()"); debugCodeAssign("ResultSetMetaData", TraceObject.RESULT_SET_META_DATA, id, "getMetaData()");
} }
Expand Down Expand Up @@ -991,7 +991,7 @@ public Timestamp getTimestamp(String columnLabel, Calendar calendar) throws SQLE
@Override @Override
public Blob getBlob(int columnIndex) throws SQLException { public Blob getBlob(int columnIndex) throws SQLException {
try { try {
int id = getNextId(TraceObject.BLOB); int id = getNextTraceId(TraceObject.BLOB);
debugCodeAssign("Blob", TraceObject.BLOB, id, "getBlob(" + columnIndex + ")"); debugCodeAssign("Blob", TraceObject.BLOB, id, "getBlob(" + columnIndex + ")");
Value v = get(columnIndex); Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcBlob(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcBlob(conn, v, id);
Expand All @@ -1011,7 +1011,7 @@ public Blob getBlob(int columnIndex) throws SQLException {
@Override @Override
public Blob getBlob(String columnLabel) throws SQLException { public Blob getBlob(String columnLabel) throws SQLException {
try { try {
int id = getNextId(TraceObject.BLOB); int id = getNextTraceId(TraceObject.BLOB);
debugCodeAssign("Blob", TraceObject.BLOB, id, "getBlob(" + quote(columnLabel) + ")"); debugCodeAssign("Blob", TraceObject.BLOB, id, "getBlob(" + quote(columnLabel) + ")");
Value v = get(columnLabel); Value v = get(columnLabel);
return v == ValueNull.INSTANCE ? null : new JdbcBlob(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcBlob(conn, v, id);
Expand Down Expand Up @@ -1103,7 +1103,7 @@ public InputStream getBinaryStream(String columnLabel) throws SQLException {
@Override @Override
public Clob getClob(int columnIndex) throws SQLException { public Clob getClob(int columnIndex) throws SQLException {
try { try {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
debugCodeAssign("Clob", TraceObject.CLOB, id, "getClob(" + columnIndex + ")"); debugCodeAssign("Clob", TraceObject.CLOB, id, "getClob(" + columnIndex + ")");
Value v = get(columnIndex); Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
Expand All @@ -1123,7 +1123,7 @@ public Clob getClob(int columnIndex) throws SQLException {
@Override @Override
public Clob getClob(String columnLabel) throws SQLException { public Clob getClob(String columnLabel) throws SQLException {
try { try {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
debugCodeAssign("Clob", TraceObject.CLOB, id, "getClob(" + quote(columnLabel) + ")"); debugCodeAssign("Clob", TraceObject.CLOB, id, "getClob(" + quote(columnLabel) + ")");
Value v = get(columnLabel); Value v = get(columnLabel);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
Expand All @@ -1143,7 +1143,7 @@ public Clob getClob(String columnLabel) throws SQLException {
@Override @Override
public Array getArray(int columnIndex) throws SQLException { public Array getArray(int columnIndex) throws SQLException {
try { try {
int id = getNextId(TraceObject.ARRAY); int id = getNextTraceId(TraceObject.ARRAY);
debugCodeAssign("Clob", TraceObject.ARRAY, id, "getArray(" + columnIndex + ")"); debugCodeAssign("Clob", TraceObject.ARRAY, id, "getArray(" + columnIndex + ")");
Value v = get(columnIndex); Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcArray(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcArray(conn, v, id);
Expand All @@ -1163,7 +1163,7 @@ public Array getArray(int columnIndex) throws SQLException {
@Override @Override
public Array getArray(String columnLabel) throws SQLException { public Array getArray(String columnLabel) throws SQLException {
try { try {
int id = getNextId(TraceObject.ARRAY); int id = getNextTraceId(TraceObject.ARRAY);
debugCodeAssign("Clob", TraceObject.ARRAY, id, "getArray(" + quote(columnLabel) + ")"); debugCodeAssign("Clob", TraceObject.ARRAY, id, "getArray(" + quote(columnLabel) + ")");
Value v = get(columnLabel); Value v = get(columnLabel);
return v == ValueNull.INSTANCE ? null : new JdbcArray(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcArray(conn, v, id);
Expand Down Expand Up @@ -3370,7 +3370,7 @@ public void updateNClob(String columnLabel, NClob x) throws SQLException {
@Override @Override
public NClob getNClob(int columnIndex) throws SQLException { public NClob getNClob(int columnIndex) throws SQLException {
try { try {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnIndex + ")"); debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnIndex + ")");
Value v = get(columnIndex); Value v = get(columnIndex);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
Expand All @@ -3390,7 +3390,7 @@ public NClob getNClob(int columnIndex) throws SQLException {
@Override @Override
public NClob getNClob(String columnLabel) throws SQLException { public NClob getNClob(String columnLabel) throws SQLException {
try { try {
int id = getNextId(TraceObject.CLOB); int id = getNextTraceId(TraceObject.CLOB);
debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnLabel + ")"); debugCodeAssign("NClob", TraceObject.CLOB, id, "getNClob(" + columnLabel + ")");
Value v = get(columnLabel); Value v = get(columnLabel);
return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id); return v == ValueNull.INSTANCE ? null : new JdbcClob(conn, v, id);
Expand Down
Expand Up @@ -66,7 +66,7 @@ public class JdbcStatement extends TraceObject implements Statement {
@Override @Override
public ResultSet executeQuery(String sql) throws SQLException { public ResultSet executeQuery(String sql) throws SQLException {
try { try {
int id = getNextId(TraceObject.RESULT_SET); int id = getNextTraceId(TraceObject.RESULT_SET);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "executeQuery(" + quote(sql) + ")"); debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "executeQuery(" + quote(sql) + ")");
} }
Expand Down Expand Up @@ -179,7 +179,7 @@ private boolean executeInternal(String sql) throws SQLException {
} }
} }
} }
int id = getNextId(TraceObject.RESULT_SET); int id = getNextTraceId(TraceObject.RESULT_SET);
checkClosed(); checkClosed();
closeOldResultSet(); closeOldResultSet();
sql = JdbcConnection.translateSQL(sql, escapeProcessing); sql = JdbcConnection.translateSQL(sql, escapeProcessing);
Expand Down Expand Up @@ -714,7 +714,7 @@ public int[] executeBatch() throws SQLException {
@Override @Override
public ResultSet getGeneratedKeys() throws SQLException { public ResultSet getGeneratedKeys() throws SQLException {
try { try {
int id = getNextId(TraceObject.RESULT_SET); int id = getNextTraceId(TraceObject.RESULT_SET);
if (isDebugEnabled()) { if (isDebugEnabled()) {
debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "getGeneratedKeys()"); debugCodeAssign("ResultSet", TraceObject.RESULT_SET, id, "getGeneratedKeys()");
} }
Expand Down
Expand Up @@ -131,7 +131,7 @@ public String getTraceObjectName() {
* @param type the object type * @param type the object type
* @return the new trace object id * @return the new trace object id
*/ */
protected static int getNextId(int type) { protected static int getNextTraceId(int type) {
return ID[type]++; return ID[type]++;
} }


Expand Down

0 comments on commit c488c01

Please sign in to comment.