[ 
https://issues.apache.org/jira/browse/OPENJPA-1029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12697473#action_12697473
 ] 

Donald Woods commented on OPENJPA-1029:
---------------------------------------

What "older" driver are you referring to?
On the Microsoft website at the link provided earlier, there are only 3 drivers 
to download -
v1.1 - SQL Server 2000/2005 JDBC Driver 1.1 is JDBC 3.0 compliant and runs on 
the Java Runtime Environment (JRE) version 1.4 and later versions
v1.2 - provides access to SQL Server 2000 and SQL Server 2005 from any Java 
application ... Type 4 JDBC driver ... is JDBC 3.0 compliant and runs on the 
Java Development Kit (JDK) version 1.4 and higher.
v2.0 - provides access to SQL Server 2000, SQL Server 2005, and SQL Server 2008 
from any Java application ... Type 4 JDBC driver ...  is JDBC 4.0 compliant and 
runs on the Java Development Kit (JDK) version 5.0 or later.

For OpenJPA, I would only suggest tolerating the 1.2 driver and 
supporting/recommending the 2.0 driver.  In my testing both worked fine, but we 
only get a SQL status code back from the 2.0 driver for query timeouts.


> SQLServerDictionary causes NumberFormatException if MS SQL JDBC v2.0 is used
> ----------------------------------------------------------------------------
>
>                 Key: OPENJPA-1029
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1029
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: third-party
>    Affects Versions: 2.0.0
>            Reporter: Donald Woods
>            Assignee: Jeremy Bauer
>             Fix For: 2.0.0
>
>         Attachments: OPENJPA-1029.patch
>
>
> If the Microsoft SQL Server JDBC Driver is used instead of the jTDS driver, 
> then the SQLServerDictionary will throw an exception while trying to parse 
> the driverName to determine the server version.  It should be using 
> meta.getDatabaseMajorVersion() instead.  Also, the MS SQL JDBC driver was not 
> being recognized, so driverVendor was not getting set to VENDOR_MICROSOFT.
> java.lang.NumberFormatException: For input string: "JDBC"
>       at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>       at java.lang.Integer.parseInt(Integer.java:447)
>       at java.lang.Integer.parseInt(Integer.java:497)
>       at 
> org.apache.openjpa.jdbc.sql.SQLServerDictionary.connectedConfiguration(SQLServerDictionary.java:92)
>       at 
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:190)
>       at 
> org.apache.openjpa.jdbc.sql.DBDictionaryFactory.newDBDictionary(DBDictionaryFactory.java:100)
>       at 
> org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getDBDictionaryInstance(JDBCConfigurationImpl.java:584)
>       at 
> org.apache.openjpa.persistence.query.TestQueryTimeout.setUp(TestQueryTimeout.java:89)
>       at junit.framework.TestCase.runBare(TestCase.java:125)
>       at 
> org.apache.openjpa.persistence.test.PersistenceTestCase.runBare(PersistenceTestCase.java:455)
>       at junit.framework.TestResult$1.protect(TestResult.java:106)
>       at junit.framework.TestResult.runProtected(TestResult.java:124)
>       at junit.framework.TestResult.run(TestResult.java:109)
>       at junit.framework.TestCase.run(TestCase.java:118)
>       at 
> org.apache.openjpa.persistence.test.PersistenceTestCase.run(PersistenceTestCase.java:182)
>       at junit.framework.TestSuite.runTest(TestSuite.java:208)
>       at junit.framework.TestSuite.run(TestSuite.java:203)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at 
> org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
>       at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>       at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>       at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:585)
>       at 
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)
>       at 
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to