19 Commits

Author SHA1 Message Date
Luke Street 93d265316f Use src-jdbc41 for Maven build; fix warnings
Support byte array dumping in JDBC 4.1 PreparedStatement
2016-11-23 10:31:16 -05:00
Luke Street 2ab2d0389e Merge remote-tracking branch 'prs/add_jdbc_4_1' 2016-11-23 10:07:14 -05:00
Luke Street f4f264f921 Merge remote-tracking branch 'prs/add_pom' 2016-11-23 10:07:02 -05:00
LEGROS 3604fe043c Byte arrays are now dumped 2016-06-23 09:49:01 +02:00
Pascal Schumacher 6a9b4e1948 add minimal pom.xml 2016-06-14 21:46:40 +02:00
Pascal Schumacher bff4f67db8 quick hack to begin jdbc 4.1 compatible implementation 2016-06-14 21:14:57 +02:00
Arthur Blake dc6edbdb86 Merge pull request #74 from jadetang/master
make RdbmsSpecifics public
2015-10-15 11:36:22 -04:00
唐思成 f637d041cc make RdbmsSpecifics public 2015-10-13 09:56:51 +08:00
Arthur Blake 7d51cd3d3f add extra blank line
add extra blank line - no functional changes
2015-09-30 13:06:14 -04:00
Arthur Blake 77507faf9c add new option, "log4jdbc.trim.sql.lines"
Unforunately, got mixed up with a partial code reformat.
Too lazy to go back and do that part as a separate commit
2015-09-30 12:30:16 -04:00
Arthur Blake 8918e4a39a remove JDBC 3 versions
JDBC 3 version no longer needed going forward
2015-09-30 12:25:14 -04:00
Arthur Blake d308e26494 add note about downloads 2015-03-30 09:22:37 -04:00
Arthur Blake 053afdbf0f Temporary README 2015-03-30 09:05:58 -04:00
ablake d3c58ab5cd add .hgignore file to hide common project/editor artifacts, etc. from mercurial 2014-11-26 08:24:18 -05:00
ablake 35b5548e2f update copyright date, no functional changes 2014-11-26 08:20:25 -05:00
convert-repo ab522b45e2 update tags 2013-03-19 20:17:26 +00:00
arthur blake 1f47f9a899 Issue 61; correct getArray method logging label (was incorrectly set to "getURL", a likely cut & paste error) 2012-12-27 13:45:43 +00:00
arthur blake f7a51cd827 oops.. tabs to spaces 2012-09-27 21:42:56 +00:00
arthur blake e261132179 bug fix ResultSetSpy.getStatement should return wrapped Statement, not real Statement (Issue 55) 2012-09-27 21:39:50 +00:00
47 changed files with 11565 additions and 9375 deletions
+3
View File
@@ -0,0 +1,3 @@
^bin$
^.project$
^.classpath$
+8
View File
@@ -0,0 +1,8 @@
# log4jdbc
A more extensive README will be created soon. For now, you can view the usage instructions at the old Google Code hosting site:
https://code.google.com/p/log4jdbc/
You can download the prebuilt jars at:
https://code.google.com/p/log4jdbc/downloads/list
+28 -12
View File
@@ -1,3 +1,19 @@
2015-09-30 1.3 release
o add new option, "log4jdbc.trim.sql.lines" which when set,
will trim SQL line by line (for beginning of line, only trimming
consistent white space) If this option is selected, the TrimSql
option will be ignored.
o remove JDBC 3 version (not all scripts updated yet.)
o getArray method improperly labeled as getURL (Issue 61.)
o bug fix ResultSetSpy.getStatement should return wrapped Statement,
not real Statement (Issue 55.)
o move to GitHub (Google Code shutting down.)
2012-02-17 1.2 Release
o escape single quotes in PreparedStatement/CallableStatement bind variables (Issue 36.)
@@ -12,51 +28,51 @@
o add new option, log4jdbc.trim.sql.extrablanklines for removing
extra blank lines from sql output.
o fix issue where extra connection was being created when
o fix issue where extra connection was being created when
ResultSet.getStatement was being called (Issue 33.)
o performance enhancement when logging not enabled (Issue 29.)
2010-06-09 1.2 beta 2 Release
o add new option, log4jdbc.auto.load.popular.drivers for
o add new option, log4jdbc.auto.load.popular.drivers for
disabling auto-loading of drivers
o look first for log4jdbc property settings in optional
o look first for log4jdbc property settings in optional
log4jdbc.properties file in the classpath.
o Fix non-threadsafe usage of SimpleDateFormat (Issue 18)
o add new option, log4jdbc.trim.sql to trim the SQL before logging
it.
o add new option, log4jdbc.suppress.generated.keys.exception that
will ignore any exception produced by the method,
will ignore any exception produced by the method,
Statement.getGeneratedKeys(). This flag is useful in Coldfusion
environments which typically call this method after every update,
even if unwarranted, and ignoring the exception, thus clogging up
even if unwarranted, and ignoring the exception, thus clogging up
the logs with these exception reports.
o add support for the newer oracle.jdbc.OracleDriver driver (the
older oracle.jdbc.driver.OracleDriver driver is still supported
as well) and add corrected date formatting for Oracle.
o fix possible null pointer issue with setBlob and setClob (Issue 21)
2010-03-20 1.2 beta 1 Release
o Check for exception that should not, but in some cases could
o Check for exception that should not, but in some cases could
occur when trying to format parameter arguments.
o Use only one type of date format so that time portion of Date
types is not dropped!
o use to_date function for Oracle (Issue 14)
o performance improvements
o fix: respect DumpSqlMaxLineLength option.
o fix: respect DumpSqlMaxLineLength option.
o various other fixes (including Issues 8 and 9)
2009-02-26 1.2 alpha 2 Release
+41
View File
@@ -0,0 +1,41 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.log4jdbc</groupId>
<artifactId>log4jdbc</artifactId>
<version>1.3-SNAPSHOT</version>
<name>log4jdbc</name>
<description>log4jdbc is a Java JDBC driver that can log SQL and/or JDBC calls (and optionally SQL timing information) for other JDBC drivers using the Simple Logging Facade For Java (SLF4J) logging system.</description>
<url>https://github.com/arthurblake/log4jdbc</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.0</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src-jdbc41</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
+6 -3
View File
@@ -1,5 +1,8 @@
log4jdbc is built with Ant 1.8.x, JDK 1.4.x and JDK 1.6.x
log4jdbc is built with Ant 1.8.x and JDK 1.6.x
The build.cmd file is useful for building both the jdbc 3 version (JDK 1.4) and
the jdbc 4 version (under JDK 1.6) under windows. The javadoc.cmd file is
The build.cmd file is useful for building both the jdbc 3 version (JDK 1.4) and
the jdbc 4 version (under JDK 1.6) under windows. The javadoc.cmd file is
useful for building javadoc (requires the 3rd party ydoc tool)
NOTE: as of 2015-09-30 the jdbc 3 version has been removed - not all build
scripts may have been updated to reflect that.
+4 -16
View File
@@ -1,23 +1,11 @@
@echo off
setlocal
REM invoke the 1.4 and the 1.6 jvm each in turn
REM for JDBC 3 and JDBC 4 versions respectively
REM (JDBC 3 version removed as of 2015-09-30)
REM invoke the 1.6 jvm for the JDBC 4 version
REM BTW, It's not actually necessary to use JDK 1.4
REM if you don't happen to have it laying around,
REM as the ant script properly sets the source
REM and target java versions anyway.
set ANT_HOME=c:\apache-ant-1.8.2
set JAVA_HOME=C:\jdk\1.4.2_19
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
call java -version
call ant -Djdbc.level=3 -Djvm.ver=1.4 all
set JAVA_HOME=C:\jdk\1.6.0_30
set ANT_HOME=c:\apache-ant-1.8.1
set JAVA_HOME=C:\jdk\1.6.0_21
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
call java -version
+4 -4
View File
@@ -9,7 +9,7 @@
built with jdk 1.4.2_13 (for use with jdbc3)
and/or jdk 1.6.0 (for use with jdbc4)
Copyright 2007-2012 Arthur Blake
Copyright 2007-2015 Arthur Blake
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@
<!-- release version -->
<property name="version" value="1.2"/>
<property name="version" value="1.3"/>
<target name="all" depends="cleancompile,compile,cleanjar,jar"/>
@@ -99,11 +99,11 @@
<delete dir="${apidocs}" />
<mkdir dir="${apidocs}" />
</target>
<target name="cleanrelease" description="clean up any release files">
<delete file="../log4jdbc-${version}.zip"/>
</target>
<target name="clean" depends="cleanrelease,cleanjavadoc,cleanjar,cleancompile" description="clean up all build artifacts"/>
<target name="release" depends="cleanrelease" description="make a complete release distribution (a .jar zip and tar.gz file for release)">
+4 -10
View File
@@ -1,19 +1,13 @@
@echo off
setlocal
REM invoke the 1.4 and the 1.6 jvm each in turn
REM for JDBC 3 and JDBC 4 versions respectively
REM (JDBC 3 version removed as of 2015-09-30)
REM invoke the 1.6 jvm for the JDBC 4 version
set ANT_HOME=c:\apache-ant-1.8.2
set ANT_HOME=c:\apache-ant-1.8.1
set ANT_OPTS=-Xmx512m
set JAVA_HOME=C:\jdk\1.4.2_19
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
call java -version
call ant -Djdbc.level=3 -Djvm.ver=1.4 ydoc.3
set JAVA_HOME=c:\jdk\1.6.0_30
set JAVA_HOME=c:\jdk\1.6.0_21
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
call java -version
+1 -1
View File
@@ -2,7 +2,7 @@
rem *************************************************************************************************
rem * *
rem * Copyright 2007-2012 Arthur Blake *
rem * Copyright 2007-2015 Arthur Blake *
rem * *
rem * Licensed under the Apache License, Version 2.0 (the "License"); *
rem * you may not use this file except in compliance with the License. *
+1 -1
View File
@@ -2,7 +2,7 @@
# *************************************************************************************************
# * *
# * Copyright 2007-2012 Arthur Blake *
# * Copyright 2007-2015 Arthur Blake *
# * *
# * Licensed under the Apache License, Version 2.0 (the "License"); *
# * you may not use this file except in compliance with the License. *
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-43
View File
@@ -1,43 +0,0 @@
/**
* Copyright 2007-2012 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.sf.log4jdbc;
/**
* Static utility methods for use throughout the project.
*/
public class Utilities {
/**
* Right justify a field within a certain number of spaces.
* @param fieldSize field size to right justify field within.
* @param field contents to right justify within field.
* @return the field, right justified within the requested size.
*/
public static String rightJustify(int fieldSize, String field)
{
if (field==null)
{
field="";
}
StringBuffer output = new StringBuffer();
for (int i=0, j = fieldSize-field.length(); i < j; i++)
{
output.append(' ');
}
output.append(field);
return output.toString();
}
}
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2012 Arthur Blake
* Copyright 2007-2015 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1597,7 +1597,7 @@ public class CallableStatementSpy extends PreparedStatementSpy implements Callab
public Array getArray(String parameterName) throws SQLException
{
String methodCall = "getURL(" + parameterName + ")";
String methodCall = "getArray(" + parameterName + ")";
try
{
return (Array) reportReturn(methodCall, realCallableStatement.getArray(parameterName));
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2012 Arthur Blake
* Copyright 2007-2015 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2012 Arthur Blake
* Copyright 2007-2015 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2012 Arthur Blake
* Copyright 2007-2015 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2012 Arthur Blake
* Copyright 2007-2015 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/**
* Copyright 2007-2012 Arthur Blake
* Copyright 2007-2015 Arthur Blake
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package net.sf.log4jdbc;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
@@ -308,7 +309,7 @@ public class PreparedStatementSpy extends StatementSpy implements PreparedStatem
public void setBlob(int i, Blob x) throws SQLException
{
String methodCall = "setBlob(" + i + ", " + x + ")";
argTraceSet(i, "(Blob)",
argTraceSet(i, "(Blob)",
x==null?null:("<Blob of size " + x.length() + ">"));
try
{
@@ -541,9 +542,14 @@ public class PreparedStatementSpy extends StatementSpy implements PreparedStatem
public void setBytes(int parameterIndex, byte[] x) throws SQLException
{
//todo: dump array?
String methodCall = "setBytes(" + parameterIndex + ", " + x + ")";
argTraceSet(parameterIndex, "(byte[])", "<byte[]>");
StringBuilder sb = new StringBuilder();
for (byte b : x) {
sb.append(String.format("%02X", b));
}
argTraceSet(parameterIndex, "(byte[])", sb.toString());
try
{
realPreparedStatement.setBytes(parameterIndex, x);

Some files were not shown because too many files have changed in this diff Show More