	private void print(Method method, Object[] args) {
        if (shouldPrint()) {
        	if ("prepareStmt".equals(method.getName())) {
        		print("prepareStmt: " + args[0]);
                if (((String)args[0]).indexOf("ODE_SCOPE") > 0) {
                    for (StackTraceElement traceElement : Thread.currentThread().getStackTrace()) {
                        print(traceElement.toString());
                    }
                }
        	} else if ("prepareCall".equals(method.getName())) {
        		print("prepareCall: " + args[0]);
        	} else if ("close".equals(method.getName())) {
        		print("close()");
        	} else if ("commit".equals(method.getName())) {
        		print("commit()");
        	} else if ("rollback".equals(method.getName())) {
        		print("rollback()");
        	} else if ("setTransactionIsolation".equals(method.getName())) {
        		print("Set isolation level to " + args[0]);
        	} 
        	  else if (method.getName().startsWith("execute")) {
        		print(method.getName() + ", " + getParams());
        	} else if ("clearParameters".equals(method.getName())) {
        		_paramsByIdx.clear();
        		_paramsByName.clear();
        	} else if ("setNull".equals(method.getName())) {
        		if (String.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByName.put((String)args[0], null);
        		} else if (Integer.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByIdx.put((Integer)args[0], null);
        		}
        	} else if (PARAMSTYPES.contains(method.getName())){
        		if (String.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByName.put((String)args[0], args[1]);
        		} else if (Integer.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByIdx.put((Integer)args[0], args[1]);
        		}
        	}
        }
	}

	private void print(Method method, Object[] args) {
        if (shouldPrint()) {
        	if ("prepareStatement".equals(method.getName())) {
        		print("prepareStmt: " + args[0]);
                if (((String)args[0]).indexOf("ODE_SCOPE") > 0) {
                    for (StackTraceElement traceElement : Thread.currentThread().getStackTrace()) {
                        print(traceElement.toString());
                    }
                }
        	} else if ("prepareCall".equals(method.getName())) {
        		print("prepareCall: " + args[0]);
        	} else if ("close".equals(method.getName())) {
        		print("close()");
        	} else if ("commit".equals(method.getName())) {
        		print("commit()");
        	} else if ("rollback".equals(method.getName())) {
        		print("rollback()");
        	} else if ("setTransactionIsolation".equals(method.getName())) {
        		print("Set isolation level to " + args[0]);
        	} 
        	  else if (method.getName().startsWith("execute")) {
        		print(method.getName() + ", " + getParams());
        	} else if ("clearParameters".equals(method.getName())) {
        		_paramsByIdx.clear();
        		_paramsByName.clear();
        	} else if ("setNull".equals(method.getName())) {
        		if (String.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByName.put((String)args[0], null);
        		} else if (Integer.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByIdx.put((Integer)args[0], null);
        		}
        	} else if (PARAMSTYPES.contains(method.getName())){
        		if (String.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByName.put((String)args[0], args[1]);
        		} else if (Integer.class.isAssignableFrom(args[0].getClass())) {
        			_paramsByIdx.put((Integer)args[0], args[1]);
        		}
        	}
        }
	}
