You could try using the jTDS driver instead and see if that works for you: http://jtds.sourceforge.net/
Watkin, James wrote: > Here's a recent related post to a Microsoft website where Microsoft > seems to be admitting flaws in their JDBC driver. Although my queries > don't use table aliases, they still fail. > > http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=mi > crosoft.public.sqlserver.jdbcdriver&tid=95a47cdd-72ce-450b-9bca-3bee0203 > 8b17&cat=en_US_22326e25-7529-45bb-a7af-96ec8a2601d7&lang=en&cr=US&sloc=& > p=1 > > Has anyone gotten DBUtils 1.2 to work with the Microsoft JDBC driver? I > haven't used the jTDS driver in a long time, does jTDS work for this > issue? Does the most recent version of jTDS work well generally? > > Jim > > -----Original Message----- > From: Watkin, James [mailto:[email protected]] > Sent: Wednesday, August 26, 2009 7:45 PM > To: Commons Users List > Subject: RE: What's required to convert from DBUtils 1.1 to DBUtils 1.2? > > Within DBUtils 1.2, these exceptions are being thrown from the call to > stmt.getParameterMetaData() within QueryRunner.fillStatement: > > public void fillStatement(PreparedStatement stmt, Object[] params) > throws SQLException { > > if (params == null) { > return; > } > > ParameterMetaData pmd = stmt.getParameterMetaData(); > ... > ... > > Some earlier SELECT queries without parameters are getting executed > without throwing any exceptions. > > DBUtils 1.1 doesn't seem to use the stmt.getParameterMetaData() call. > > This is failing with the latest Microsoft JDBC driver, version 2.0, > sqljdbc4.jar, with Java 1.6.0_11. I suppose I can try updating my JDK. > > Jim > > -----Original Message----- > From: Watkin, James [mailto:[email protected]] > Sent: Wednesday, August 26, 2009 6:32 PM > To: Commons Users List > Subject: RE: What's required to convert from DBUtils 1.1 to DBUtils 1.2? > > Mark, > > Thank you for your reply. My app breaks with the following exception: > > java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException: > Incorrect syntax near the keyword 'FROM'. Query: SELECT program FROM > programs WHERE (code = ?) Parameters: [MFE] > at > org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:540) > at > org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:397) > at > org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:352) > > I've tried replacing my MS SQL Driver with the latest download, but that > doesn't help. When I comment out the code throwing the error, I get an > error on the next query: > > Caused by: java.sql.SQLException: > com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near > ','. Query: SELECT a.serial FROM applicants_ext ae JOIN applicants a ON > ae.applicant_serial = a.serial WHERE (ae.applicant_ext_serial = ?) AND > (ae.app_type = ?) AND (a.year = ?) Parameters: [XXXXXXX, A, 2010] > at > org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:540) > at > org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:397) > at > org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:369) > > Jim > > -----Original Message----- > From: Mark Shifman [mailto:[email protected]] > Sent: Wednesday, August 26, 2009 4:40 AM > To: Commons Users List > Subject: Re: What's required to convert from DBUtils 1.1 to DBUtils 1.2? > > Almost nothing is required to convert to 1.2. Read the release notes > and see if any of the changes affect you. > http://commons.apache.org/dbutils/changes-report.html > > I was burned by the way they changed CaseInsensitiveHashMap so I just > overrode it with the old one. I also had a problem because of > oracle (so what else is new) but when I upgraded to the newest driver > things worked fine. > > How does 1.2 break your app? > mas > > > Watkin, James wrote: >> I'm experiencing a well-known problem with DBUtils 1.1 where sometimes >> NULLs are converted to 0 when read from the database -- >> http://issues.apache.org/jira/browse/DBUTILS-42 >> >> >> >> I see that DBUtils 1.2 fixes this problem. However, DBUtils 1.2 breaks >> my app. Before I commit to "fixing" my app, can anyone outline the >> amount of work required to upgrade one's app for use with DBUtils 1.2? >> I'm using the MS SQL Server JDBC driver. >> >> >> >> Thank you. >> >> >> >> Jim >> >> >> >> >> >> > -- Dennis Lundberg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
