SQL Server 2000 - SQL type is not supported

User 228b062b7c

12-01-2006 09:34:35

Hi,





I'm trying to build a web application with ASP and MS SQL Server 2000 with JChem 3.1.4. The Java SDK 1.5 and the necessary jdbc drivers are installed on the W2k server. I can connect to the databases with the JChemManager and a structure table is created.


I failed to succeed in getting the asp example to run. The registering of the UpdateHandler bean as ActiveX gave back the classDefNotFound error for the oracle/sql/CLOB, although the ojdbc14.jar was in the classpath. So I gave up on ASP and installed a tomcat and an isapi_redirect on the server and got the IIS to handle jsps. The example/jsp1_x are running. Imports are working fine, as well as queries. But when I try to make an INSERT I get the following error:





SQLState: HY004


Message: [Microsoft][SQLServer 2000 Driver for JDBC]The specified SQL type is not supported by this driver.


Vendor: 0






Is there a way to get around this?





Regards,





Florian

ChemAxon 9c0afc9aaf

12-01-2006 14:07:00

Hi,





So far we could not reproduce the problem, inserting works fine for me in the JSP example using MS SQLServer.





Please let me know the following:


- The full stack trace


- The exact version of the DB server


- The JDBC driver version (if possible with download link)


- Does updating the driver helps ?


- The URL used for the JDBC connection


- Is there any difference if you replace "uh.execute(true);" in update.jsp to "uh.execute(false);" ?





Best regards,





Szilard

User 228b062b7c

12-01-2006 16:07:49

Hi Szilard,





this is what I have:
Szilard wrote:



Please let me know the following:


- The full stack trace


java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The specified SQL type is not supported by this driver.


com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)


com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)


com.microsoft.jdbc.base.BasePreparedStatement.validateSqlType(Unknown Source)


com.microsoft.jdbc.base.BasePreparedStatement.setObjectInternal(Unknown Source)


com.microsoft.jdbc.base.BasePreparedStatement.setNull(Unknown Source)


chemaxon.jchem.db.UpdateHandler.setValue(UpdateHandler.java:1226)


chemaxon.jchem.db.UpdateHandler.setStmt(UpdateHandler.java:1286)


chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:1521)


org.apache.jsp.examples.jsp1_005fx.update_jsp._jspService(org.apache.jsp.examples.jsp1_005fx.update_jsp:429)


org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)


javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)


org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)


org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)


javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Szilard wrote:
- The exact version of the DB server
SQL Server Developer Edition


Product Version 8.00.2039(SP4)


on Microsoft Windows NT - 5.0(2195)
Szilard wrote:
- The JDBC driver version (if possible with download link)
SQL Server 2000 Driver for JDBC Service Pack 3, Version: 2.2.0040


http://www.microsoft.com/downloads/details.aspx?FamilyID=07287b11-0502-461a-b138-2aa54bfdc03a&DisplayLang=en
width="90%" cellspacing="0" cellpadding="3" border="0" align="center"> Szilard wrote: - Does updating the driver helps ? I think it is the latest available driver
Szilard wrote:
- The URL used for the JDBC connection
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=db_name;SelectMethod=cursor





com.microsoft.jdbc.sqlserver.SQLServerDriver
Szilard wrote:



- Is there any difference if you replace "uh.execute(true);" in update.jsp to "uh.execute(false);" ?


It doesn't make any difference.





Thanks for your efforts.


Best regards,


Florian

ChemAxon 9c0afc9aaf

12-01-2006 18:22:46

Hi,





Thank you for the information, the stack trace helped a lot.


I could reproduce the problem now.


It occurs if there are one or more extra data fields and you do not specify a value for them.


Still working on the problem, but I can already offer a temporary workaround:





Replace the following line in update.jsp:





Code:
structureTableName, fields);





with the following:





Code:
structureTableName, fields.toLowerCase());






I will also notify you when the real fix is ready.





Best regards,





Szilard

ChemAxon 9c0afc9aaf

12-01-2006 18:59:59

We have fixed the problem, the next JChem release (3.1.5) will contain the fix.





Kind regards,





Szilard

User 228b062b7c

12-01-2006 22:39:18

Hi,





Thanks a lot!


It's working fine now.





Best regards,





Florian