walterDurin / sqlite-jdbc

Automatically exported from code.google.com/p/sqlite-jdbc
Apache License 2.0
0 stars 0 forks source link

Unable to use sqlite-jdbc driver in Ant tasks #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ant projects with sql task fail when used with the sqlite-jdbc driver. Attached 
build script fails with following error:

C:\Users\jec\build.xml:9: java.sql.SQLException: not implemented by SQLite JDBC
driver
        at org.sqlite.Unused.unused(Unused.java:29)
        at org.sqlite.Unused.setEscapeProcessing(Unused.java:36)
        at org.apache.tools.ant.taskdefs.SQLExec.getStatement(SQLExec.java:962)
        at org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:775)
        at org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.java:751)
        at org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransaction(SQLExec.java:1043)
        at org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000(SQLExec.java:985)
        at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:653)

Problem here is that SQLExec ant task calls setEscapeProcessing() on 
PreparedStatement, which always fails. Ideally it should be implemented, but at 
least should only fail if you change it from the default value. 

Original issue reported on code.google.com by joel.car...@gmail.com on 7 Jun 2011 at 5:32

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by taroleo on 21 Jun 2011 at 5:50

GoogleCodeExporter commented 9 years ago
This also fails when called from Maven. 

[DEBUG] Configuring mojo 'org.codehaus.mojo:sql-maven-plugin:1.5:execute' -->
[DEBUG]   (f) autocommit = true
[DEBUG]   (s) delimiter = ;
[DEBUG]   (s) delimiterType = normal
[DEBUG]   (s) driver = org.sqlite.JDBC
[DEBUG]   (f) enableAnonymousPassword = true
[DEBUG]   (f) enableFiltering = false
[DEBUG]   (s) encoding = UTF-8
[DEBUG]   (s) escapeProcessing = false
[DEBUG]   (f) forceMojoExecution = false
[DEBUG]   (s) keepFormat = false
[DEBUG]   (f) mavenSession = org.apache.maven.execution.MavenSession@3f00b6a
[DEBUG]   (s) onError = abort
[DEBUG]   (f) outputDelimiter = ,
[DEBUG]   (s) printResultSet = false
[DEBUG]   (f) project = MavenProject: 
com.xxxxximages:VIPSRedirectConfig:0.0.1-dev @ 
C:\xxxxxDev\ProfessionalServices\dev\trunk\VIPSRedirectConfig\pom.xml
[DEBUG]   (f) settings = org.apache.maven.settings.Settings@4dc2f330
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipOnConnectionError = false
[DEBUG]   (s) srcFiles = 
[C:\xxxxxDev\ProfessionalServices\dev\trunk\VIPSRedirectConfig\src\main\sql\buil
d.sql]
[DEBUG]   (s) url = jdbc:sqlite:hello.db
[DEBUG] -- end configuration --
[INFO] [sql:execute {execution: create-db}]
[DEBUG] properties used {java.vendor=Oracle Corporation, 
env.SYSTEMROOT=C:\Windows, sun.java.launcher=SUN_STANDARD, 
sun.management.compiler=HotSpot 64-Bit Tiered Compilers, 
env.xxxxx_DATA=c:\xxxxxData, env.PROMPT=$P$G, os.name=Windows 7, 
env.FP_NO_HOST_CHECK=NO, sun.boot.class.path=C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\resources.jar;C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\rt.jar;C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\sunrsasign.jar;C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\jsse.jar;C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\jce.jar;C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\charsets.jar;C:\Program 
Files\Java\jdk1.7.0_01\jre\classes, env.COMPUTERNAME=xxxxxxx, 
env.ALLUSERSPROFILE=C:\ProgramData, sun.desktop=windows, 
java.vm.specification.vendor=Oracle Corporation, 
java.runtime.version=1.7.0_01-b08, env.HOMEPATH=\, 
project.build.sourceEncoding=UTF-8, 
env.HOMESHARE=\\xxxxximages.com\corporate\users\xxxxxx, user.name=xxxxx, 
idea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 
11.0.2\bin, env.WINDOWS_TRACING_FLAGS=3, env.PATH=C:\Program Files 
(x86)\JetBrains\IntelliJ IDEA 
11.0.2\bin\..\.\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files 
(x86)\CollabNet\Subversion Client;C:\Program Files (x86)\ATI 
Stream\bin\x86_64;C:\Program Files (x86)\ATI 
Stream\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Progra
m Files (x86)\Enterprise Vault\EVClient\;C:\Program Files 
(x86)\Intel\Services\IPT\;C:\Program Files\TortoiseSVN\bin;C:\Program Files 
(x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL 
Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL 
Server\100\DTS\Binn\;U:\dev\maven\apache-maven-3.0.3\bin;C:\Utilities\apache-ant
\apache-ant-1.8.1\bin;C:\Program Files\Java\jdk1.7.0_01;C:\Program 
Files\Java\jdk1.7.0_01\bin;C:\Utilities\protoc;C:\Program Files (x86)\xxxxx 
Images\PMShell;U:\dev\unzip;C:\xxxxxDev\EPIDev\trunk\local\tools\bin;C:\Utilitie
s\Maven\apache-maven-2.2.1-bin\apache-maven-2.2.1\bin;C:\apache-ant-1.8.0\bin;c:
\program files\java\jdk1.7.0_01\jre\bin, user.language=en, 
env.WINDIR=C:\Windows, sun.boot.library.path=C:\Program 
Files\Java\jdk1.7.0_01\jre\bin, 
classworlds.conf=C:\Utilities\Maven\apache-maven-2.2.1-bin\apache-maven-2.2.1\bi
n\m2.conf, powermock.version=1.4.9, java.version=1.7.0_01, 
env.PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 42 Stepping 7, GenuineIntel, 
user.timezone=America/Chicago, env.TEMP=C:\Users\xxxxx\AppData\Local\Temp, 
sun.arch.data.model=64, 
env.WINDOWS_TRACING_LOGFILE=C:\BVTBin\Tests\installpackage\csilogfile.log, 
java.endorsed.dirs=C:\Program Files\Java\jdk1.7.0_01\jre\lib\endorsed, 
sun.cpu.isalist=amd64, env.HOMEDRIVE=U:, sun.jnu.encoding=Cp1252, 
file.encoding.pkg=sun.io, spring.framework.version=3.0.5.RELEASE, 
env.SYSTEMDRIVE=C:, file.separator=\, java.specification.name=Java Platform API 
Specification, java.class.version=51.0, sqlite4java.version=0.282, 
user.country=US, java.home=C:\Program Files\Java\jdk1.7.0_01\jre, 
env.APPDATA=C:\Users\xxxxx\AppData\Roaming, env.PUBLIC=C:\Users\Public, 
java.vm.info=mixed mode, env.OS=Windows_NT, os.version=6.1, path.separator=;, 
env.ATISTREAMSDKROOT=C:\Program Files (x86)\ATI Stream\, 
java.vm.version=21.1-b02, env.xxxxx_DEPS=c:\xxxxxDev\deps, user.variant=, 
env.USERPROFILE=C:\Users\xxxxx, env.JAVA_HOME=C:\Program 
Files\Java\jdk1.7.0_01, java.awt.printerjob=sun.awt.windows.WPrinterJob, 
env.TMP=C:\Users\xxxxx\AppData\Local\Temp, env.PROGRAMFILES=C:\Program Files, 
sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.WToolkit, 
user.script=, user.home=C:\Users\xxxxx, env.COMMONPROGRAMFILES=C:\Program 
Files\Common Files, env.SESSIONNAME=Console, java.specification.vendor=Oracle 
Corporation, 
env.M2_HOME=C:\Utilities\Maven\apache-maven-2.2.1-bin\apache-maven-2.2.1, 
java.library.path=C:\Program 
Files\Java\jdk1.7.0_01\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Window
s;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 
11.0.2\bin\..\.\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\Program Files 
(x86)\CollabNet\Subversion Client;C:\Program Files (x86)\ATI 
Stream\bin\x86_64;C:\Program Files (x86)\ATI 
Stream\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Progra
m Files (x86)\Enterprise Vault\EVClient\;C:\Program Files 
(x86)\Intel\Services\IPT\;C:\Program Files\TortoiseSVN\bin;C:\Program Files 
(x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL 
Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL 
Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL 
Server\100\DTS\Binn\;U:\dev\maven\apache-maven-3.0.3\bin;C:\Utilities\apache-ant
\apache-ant-1.8.1\bin;C:\Program Files\Java\jdk1.7.0_01;C:\Program 
Files\Java\jdk1.7.0_01\bin;C:\Utilities\protoc;C:\Program Files (x86)\xxxxx 
Images\PMShell;U:\dev\unzip;C:\xxxxxDev\EPIDev\trunk\local\tools\bin;C:\Utilitie
s\Maven\apache-maven-2.2.1-bin\apache-maven-2.2.1\bin;C:\apache-ant-1.8.0\bin;c:
\program files\java\jdk1.7.0_01\jre\bin;., env.NUMBER_OF_PROCESSORS=4, 
java.vendor.url=http://java.oracle.com/, env.COMMONPROGRAMFILES(X86)=C:\Program 
Files (x86)\Common Files, env.USERDNSDOMAIN=xxxxxIMAGES.COM, 
env.PSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\, 
java.vm.vendor=Oracle Corporation, 
maven.home=C:\Utilities\Maven\apache-maven-2.2.1-bin\apache-maven-2.2.1, 
java.runtime.name=Java(TM) SE Runtime Environment, 
sun.java.command=com.intellij.rt.execution.application.AppMain 
org.codehaus.classworlds.Launcher --no-plugin-registry --debug --fail-fast 
--no-plugin-updates --strict-checksums --update-snapshots -f 
C:\xxxxxDev\ProfessionalServices\dev\trunk\VIPSRedirectConfig\pom.xml compile, 
java.class.path=C:\Utilities\Maven\apache-maven-2.2.1-bin\apache-maven-2.2.1\boo
t\classworlds-1.1.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 
11.0.2\lib\idea_rt.jar, env.PROGRAMW6432=C:\Program Files, 
hibernate.version=4.1.0.Final, idea.launcher.port=7540, 
env.PROGRAMFILES(X86)=C:\Program Files (x86), 
spring.security.version=3.1.0.RC1, java.vm.specification.name=Java Virtual 
Machine Specification, env.LOGONSERVER=\\SRV-DCMNCL2, 
java.vm.specification.version=1.7, env.PROCESSOR_ARCHITECTURE=AMD64, 
env.COMMONPROGRAMW6432=C:\Program Files\Common Files, sun.cpu.endian=little, 
sun.os.patch.level=Service Pack 1, 
env.ANT_HOME=C:\Utilities\Ant\apache-ant-1.8.1-bin\apache-ant-1.8.1, 
env.UATDATA=C:\Windows\SysWOW64\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77
, env.PROCESSOR_REVISION=2a07, 
java.io.tmpdir=C:\Users\xxxxx\AppData\Local\Temp\, 
java.vendor.url.bug=http://bugreport.sun.com/bugreport/, 
env.PROGRAMDATA=C:\ProgramData, env.COMSPEC=C:\Windows\system32\cmd.exe, 
os.arch=amd64, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, 
java.ext.dirs=C:\Program 
Files\Java\jdk1.7.0_01\jre\lib\ext;C:\Windows\Sun\Java\lib\ext, 
env.LOCALAPPDATA=C:\Users\xxxxx\AppData\Local, 
user.dir=C:\xxxxxDev\ProfessionalServices\dev\trunk\VIPSRedirectConfig, 
line.separator=
, java.vm.name=Java HotSpot(TM) 64-Bit Server VM, 
env.PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC, 
env.USERNAME=xxxxx, file.encoding=UTF-8, env.VS100COMNTOOLS=c:\Program Files 
(x86)\Microsoft Visual Studio 10.0\Common7\Tools\, env.USERDOMAIN=xxxxx, 
java.specification.version=1.7, env.PROCESSOR_LEVEL=6}
[DEBUG] copy 
C:\xxxxxDev\ProfessionalServices\dev\trunk\VIPSRedirectConfig\src\main\sql\build
.sql to C:\Users\xxxxx\AppData\Local\Temp\build.362500239sql
[DEBUG] connecting to jdbc:sqlite:hello.db
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] not implemented by SQLite JDBC driver

[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: not implemented by 
SQLite JDBC driver
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.apache.maven.plugin.MojoExecutionException: not implemented by 
SQLite JDBC driver
    at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:681)
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 22 more
Caused by: java.sql.SQLException: not implemented by SQLite JDBC driver
    at org.sqlite.Unused.unused(Unused.java:29)
    at org.sqlite.Unused.setEscapeProcessing(Unused.java:36)
    at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:630)
    ... 24 more

Original comment by martynsp...@gmail.com on 9 Mar 2012 at 9:04

GoogleCodeExporter commented 9 years ago
This is a true/false setting. Surely one or the other is supported. So in the 
method, just throw an exception if it's not the value you support. That takes 
like two lines of code and doesn't require you to implement anything.

As it stands, categorically throwing an exception renders the driver completely 
unusable with sql-maven-plugin.

Original comment by garretdw...@gmail.com on 25 Aug 2012 at 6:04

GoogleCodeExporter commented 9 years ago
Moved to bitbucket issue: https://bitbucket.org/xerial/sqlite-jdbc/issue/17

Original comment by Grace.Ba...@gmail.com on 8 Sep 2012 at 5:21

GoogleCodeExporter commented 9 years ago
The change for this is done now on bitbucket: 
https://bitbucket.org/xerial/sqlite-jdbc/changeset/37eabf39bb91

Original comment by Grace.Ba...@gmail.com on 12 Sep 2012 at 2:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Right... so when does the sqlite-jdbc library on Maven get updated? It still 
says 3.72. http://mvnrepository.com/artifact/org.xerial/sqlite-jdbc

Original comment by garretdw...@gmail.com on 11 Mar 2013 at 5:44

GoogleCodeExporter commented 9 years ago
It is claimed that this issue is fixed, yet the latest version on 
http://mvnrepository.com/artifact/org.xerial/sqlite-jdbc is still 3.7.2. The 
download site at https://bitbucket.org/xerial/sqlite-jdbc/downloads indicates 
that there is a later version for download, but 
https://bitbucket.org/xerial/sqlite-jdbc#markdown-header-using-sqlitejdbc-with-m
aven2 still refers to version 3.7.2. Have you guys abandoned Maven?

Original comment by garretdw...@gmail.com on 19 Jun 2013 at 4:19

GoogleCodeExporter commented 9 years ago
Thanks to Taro Saito, version 3.7.15-M1 contains this fix and has been pushed 
to Maven Central. Thank you, Taro!

Original comment by garretdw...@gmail.com on 24 Jun 2013 at 2:11