44 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
arthur blake ee5468cfe6 prepare for release 2012-02-17 23:01:18 +00:00
arthur blake 88f90f8131 update copyright notice for 2012 2012-02-17 22:57:44 +00:00
arthur.blake 7f7d2f0f3b update build scripts to use latest 1.6 jdk and ant releases 2012-02-16 22:31:04 +00:00
arthur blake d430b481a4 escape single quotes in PreparedStatement/CallableStatement bind variables (Issue 36.) 2011-06-22 18:31:24 +00:00
arthur blake 48154128a9 process SQL consistently when the sql is dumped because an exception occurred 2011-06-22 18:28:57 +00:00
arthur blake dbc63df301 bump versions of jdk used for javadoc src with ydoc.3 and ydoc.4 targets 2011-06-20 13:09:42 +00:00
arthur blake 59ecc4ac8b new SQL formatter to more reliably dump sql that can be run for MySql (Issue 34) 2011-06-20 13:06:42 +00:00
arthur blake d10afb244f don't show debug info in sql timing dump unless debug is enabled on the logger (to make the sql timing dump consistent with the way other the loggers work) 2011-06-20 12:54:31 +00:00
arthur blake c183dc2b5d update copyright for 2011 2011-03-02 14:09:21 +00:00
arthur blake a3ac1c68c1 modify scripts to prepare for 1.2 release 2011-03-02 14:04:58 +00:00
arthur blake 46c13d8498 add new option, log4jdbc.trim.sql.extrablanklines for removing extra blank lines from sql output 2011-03-02 14:03:48 +00:00
arthur blake 6906f31ba5 fixed Issue 33:ResultSet.getStatement creates new Connection 2011-01-08 03:20:23 +00:00
arthur.blake d3a48845f3 Issue 29; performance improvement 2010-09-08 01:59:00 +00:00
arthur.blake 7355247886 finalize release date for next beta release in CHANGES file
update copyright date in license file
2010-06-10 00:16:40 +00:00
arthur.blake 00369eba9f fix possible null pointer issue with setBlob and setClob (Issue 21) 2010-06-07 14:04:34 +00:00
arthur.blake a02f682e7c fix; Timestamp check has to be done first because Timestamp extends Date 2010-05-28 01:03:49 +00:00
arthur.blake a5290edf4b Issue 14; add support for the newer oracle.jdbc.OracleDriver driver (the older oracle.jdbc.driver.OracleDriver driver is still supported as well.) 2010-05-28 00:37:22 +00:00
arthur.blake 9769dbc6dd add new option, log4jdbc.suppress.generated.keys.exception for ColdFusion 2010-05-27 23:49:12 +00:00
arthur.blake b0b69fdc64 add new option, log4jdbc.trim.sql to trim the SQL before logging it (previously the sql was always trimmed) 2010-05-24 11:07:46 +00:00
arthur.blake 1dd40a2f76 Issue 18; Fix non-threadsafe usage of SimpleDateFormat 2010-05-15 18:24:24 +00:00
arthur.blake bbf255e0b4 look first for log4jdbc property settings in optional log4jdbc.properties in the classpath 2010-05-12 13:17:28 +00:00
arthur.blake 4ee6d5f745 upgrade from slf4j 1.5.0 to 1.6.0 2010-05-11 15:54:39 +00:00
arthur.blake c83e89c194 bump version numbers for upcoming 1.2 beta 2 release 2010-05-10 20:31:46 +00:00
arthur.blake 5ac146eb77 add system property log4jdbc.auto.load.popular.drivers for disabling auto-loading of drivers 2010-05-10 20:30:48 +00:00
arthur.blake cab8caa20a don't build tar.gz file in release target, and use consistent jdk in javadoc.cmd 2010-03-21 02:26:36 +00:00
51 changed files with 11723 additions and 9063 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
+66 -5
View File
@@ -1,17 +1,78 @@
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.)
o process SQL consistently when the sql is dumped because an exception occurred.
o new SQL formatter to more reliably dump sql that can be run for MySql (Issue 34.)
o don't show debug info in sql timing dump unless debug is enabled on the logger
(to make the sql timing dump consistent with the way other the loggers work)
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
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
disabling auto-loading of drivers
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,
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
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
+1 -1
View File
@@ -1,6 +1,6 @@
log4jdbc is open source software, released under the Apache License, Version 2.0:
Copyright 2007-2008 Arthur Blake
Copyright 2007-2011 Arthur Blake
Licensed under the Apache License, Version 2.0 (the "License");
you may not use log4jdbc except in compliance with the License.
+2
View File
@@ -18,3 +18,5 @@ o review dumpedSql method - make auto line breaking option (& num chars used) b
o need log4jdbc.debug.stack.regex so that the stack matching can take place via regex
o maven2 repository support
o this may be a better solution to SimpleDateFormat contention issue: http://www.javaspecialists.eu/archive/Issue172.html
Binary file not shown.
Binary file not shown.
+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>
+7 -4
View File
@@ -1,5 +1,8 @@
To build log4jdbc, you must have Ant 1.6.5 or later installed,
and JDK 1.4 and JDK 1.6 installed.
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 useful for building javadoc (requires the 3rd party ydoc tool)
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.7.1
set JAVA_HOME=C:\jdk\1.4.2_18
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_16
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
+7 -14
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-2010 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.2beta1"/>
<property name="version" value="1.3"/>
<target name="all" depends="cleancompile,compile,cleanjar,jar"/>
@@ -70,7 +70,7 @@
<target name="compile" description="compile all the source code">
<javac source="${jvm.ver}" target="${jvm.ver}" srcdir="${src}" destdir="${classes}"
deprecation="true" debug="true">
deprecation="true" debug="true" includeAntRuntime="false">
<classpath>
<pathelement location="$src"/>
<fileset dir="lib">
@@ -99,24 +99,17 @@
<delete dir="${apidocs}" />
<mkdir dir="${apidocs}" />
</target>
<target name="cleanrelease" description="clean up any release files">
<delete file="../log4jdbc-${version}.zip"/>
<delete file="../log4jdbc-${version}.tar"/>
<delete file="../log4jdbc-${version}.tar.gz"/>
</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)">
<zip destfile="../log4jdbc-${version}.zip">
<zipfileset dir="." prefix="log4jdbc-${version}" excludes="*.zip,*.tar.gz,*,iml,*.ipr,*.iws,thirdparty-stuff/**,classes*/**"/>
</zip>
<tar destfile="../log4jdbc-${version}.tar">
<tarfileset dir="." prefix="log4jdbc-${version}" excludes="*.zip,*.tar.gz,*,iml,*.ipr,*.iws,thirdparty-stuff/**,classes*/**"/>
</tar>
<gzip destfile="../log4jdbc-${version}.tar.gz" src="../log4jdbc-${version}.tar"/>
<delete file="../log4jdbc-${version}.tar"/>
</target>
<!-- make the javadoc (or ydoc which includes UML diagrams) -->
@@ -166,7 +159,7 @@
<!-- note that the jdk source code is referenced here so that javadoc will be generated from
interface class methods when none is specified in the implementation -->
<sourcepath path="/jdk/1.4.2_18/src"/>
<sourcepath path="/jdk/1.4.2_19/src"/>
<link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
<!--
<link href="http://java.sun.com/j2ee/1.4/docs/api/"/>
@@ -213,7 +206,7 @@
<!-- note that the jdk source code is referenced here so that javadoc will be generated from
interface class methods when none is specified in the implementation -->
<sourcepath path="/jdk/1.6.0_11/src"/>
<sourcepath path="/jdk/1.6.0_21/src"/>
<link href="http://java.sun.com/javase/6/docs/api/"/>
<link href="http://www.slf4j.org/api/"/>
+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.7.1
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_16
set JAVA_HOME=c:\jdk\1.6.0_21
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin
call java -version
+2 -2
View File
@@ -2,7 +2,7 @@
rem *************************************************************************************************
rem * *
rem * Copyright 2007-2010 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. *
@@ -25,4 +25,4 @@ rem * profiling output report.
rem * *
rem *************************************************************************************************
java -Xmx1024m -classpath ..\build\log4jdbc3-1.2beta1.jar net.sf.log4jdbc.PostLogProfilerProcessor %*
java -Xmx1024m -classpath ..\build\log4jdbc3-1.2.jar net.sf.log4jdbc.PostLogProfilerProcessor %*
+2 -2
View File
@@ -2,7 +2,7 @@
# *************************************************************************************************
# * *
# * Copyright 2007-2010 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. *
@@ -25,4 +25,4 @@
# * *
# *************************************************************************************************
java -Xmx1024m -classpath ../build/log4jdbc3-1.2beta1.jar net.sf.log4jdbc.PostLogProfilerProcessor $@
java -Xmx1024m -classpath ../build/log4jdbc3-1.2.jar net.sf.log4jdbc.PostLogProfilerProcessor $@
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-2010 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-2010 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-2010 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

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