CSVREAD - getting jdbc.JdbcSQLException with AUTO_SERVER=true option and 2 client connections

94 views
Skip to first unread message

spacewiz

unread,
Dec 18, 2012, 2:22:12 PM12/18/12
to h2-da...@googlegroups.com
Hello,

I've been consistently getting the same exception when using CSVREAD to import file into a database.
The scenario is as follows:

1) Client 1 connects to a db file using URL:

jdbc:h2:~/build_output/mydb;IGNORECASE=TRUE;AUTO_SERVER=TRUE


2) Client 2 connects to a db file using same URL:

jdbc:h2:~/build_output/mydb;IGNORECASE=TRUE;AUTO_SERVER=TRUE


3) Client 2 connects attempts to run the following query:

CREATE  TABLE raw_data_ad_performance AS SELECT * FROM CSVREAD('datafile.csv',null,'caseSensitiveColumnNames=true charset=UTF-8 fieldSeparator=,')


And Client 2 gets an exception:


org.h2.jdbc.JdbcSQLException: Unsupported connection setting "caseSensitiveColumnNames"; SQL statement:

CREATE  TABLE raw_data_ad_performance AS SELECT * FROM CSVREAD('datafile.csv',null,'caseSensitiveColumnNames=true charset=UTF-8 fieldSeparator=,')  [90113-154]

at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)

at org.h2.message.DbException.get(DbException.java:167)

at org.h2.message.DbException.get(DbException.java:144)

at org.h2.tools.Csv.setOptions(Csv.java:819)

at org.h2.expression.Function.getValueForColumnList(Function.java:1924)

at org.h2.table.FunctionTable.<init>(FunctionTable.java:63)

at org.h2.command.Parser.readTableFilter(Parser.java:1060)

at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1669)

at org.h2.command.Parser.parseSelectSimple(Parser.java:1776)

at org.h2.command.Parser.parseSelectSub(Parser.java:1663)

at org.h2.command.Parser.parseSelectUnion(Parser.java:1508)

at org.h2.command.Parser.parseSelect(Parser.java:1496)

at org.h2.command.Parser.parseCreateTable(Parser.java:5028)

at org.h2.command.Parser.parseCreate(Parser.java:3767)

at org.h2.command.Parser.parsePrepared(Parser.java:320)

at org.h2.command.Parser.parse(Parser.java:275)

at org.h2.command.Parser.parse(Parser.java:247)

at org.h2.command.Parser.prepare(Parser.java:201)

at org.h2.command.Parser.prepareCommand(Parser.java:214)

at org.h2.engine.Session.prepareLocal(Session.java:426)

at org.h2.server.TcpServerThread.process(TcpServerThread.java:226)

at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)

at java.lang.Thread.run(Thread.java:680)


at org.h2.engine.SessionRemote.done(SessionRemote.java:567)

at org.h2.command.CommandRemote.prepare(CommandRemote.java:67)

at org.h2.command.CommandRemote.<init>(CommandRemote.java:46)

at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:439)

at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1114)

at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:74)

at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:265)

...................



I have been able to reproduce this with different clients and on different database files.


The exception does NOT occur if only Client 2 connects to the database and runs above CSVREAD function - it works just fine with one client.



Thank you,

Oleg Kozlov

Thomas Mueller

unread,
Dec 18, 2012, 2:37:45 PM12/18/12
to H2 Google Group
Hi,

You are using an old version (1.3.154 from 2011-04-04), where I guess this feature is not yet supported. I suggest to try again using a more recent version.

Regards,
Thomas



On Tue, Dec 18, 2012 at 8:22 PM, spacewiz <ok8...@gmail.com> wrote:
154

spacewiz

unread,
Dec 18, 2012, 5:54:43 PM12/18/12
to h2-da...@googlegroups.com
Thomas,

Yes, that was it, my client 1 was DbVisualizer which was using driver from 1.3.154 in it's classpath, while client 2 (my app) was using 1.3.169.
It works now after updating DbVis to 1.3.169.

Thanks!
Reply all
Reply to author
Forward
0 new messages