NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

I have problem maybe at java.sql.DriverManager.getConnection(DriverManager.java:579)

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Antony7U



Joined: 20 May 2012
Posts: 2

PostPosted: Sun May 20, 2012 9:01 pm    Post subject: I have problem maybe at java.sql.DriverManager.getConnection(DriverManager.java:579) Reply with quote

Dear All,
Could you please help me I have a strange issue.
I have created a small program to reproduce the issue.

Test cases:
1) The error comes only with Java runtime 64 bit and with the driver AccessDatabaseEngine_x64.exe
2) If I try to debug (delayed run) the problem does not appear. Seems the problem happens only when the code are run very fast (I run it on sandy bridge with 4 CPU cores).
3) on 64bit it works if I comment out the line 12+13 at Main.jar or also if you clone the lines like create new tblC maybe it cause new delays?!
4)The problem does not appear if I switch to Java runtime 32 bit and MSAccess 32bit driver but that is not acceptable Sad

I get exception:
SEVERE: null
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6956)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7113)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3906)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5697)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353)
at sun.jdbc.odbc.JdbcOdbcConnection.buildTypeInfo(JdbcOdbcConnection.java:1503)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:381)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at testdriver.TBLCont.<init>(TBLCont.java:21)
at testdriver.Main.test(Main.java:12)
at testdriver.Main.main(Main.java:32)



TestDriver.zip
 Description:
On NetBeans IDE 7.1.2 + java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)

Download
 Filename:  TestDriver.zip
 Filesize:  708.63 KB
 Downloaded:  90 Time(s)

Back to top
Antony7U



Joined: 20 May 2012
Posts: 2

PostPosted: Mon May 21, 2012 5:59 pm    Post subject: Re: I have problem maybe at java.sql.DriverManager.getConnection(DriverManager.java:579) Reply with quote

I do some new tests and I add a time delay to the code and it does not depend how fast it runs as the println counter(50) stops at same exception position.
But set break point to counter 49 then start debug I do not get the problem seems there is a buffer clear time? or GC?
And seems if I change at that String:
“String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ="…”;DriverID=25;"
and that parameter:
DriverID=25 or to DriverID=22
then I get faster (counter 38 ) the error message with “Invalid string or buffer length”
Question is maybe how to free up that buffer?

Maybe it is near too that symptom connection caching parameters:
http://forums.visokio.com/discussion/1087/refresh-from-source-task-of-database-blockodbc-fails-to-execute.
Unfortunately I do not know, how to implement that solution to my project it is undocumented for that MSDriver. Or contact MS Support? I am doubt here is it the driver or the GC or the JVM which cause that problem? Any further idea how to solve it?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo