I am trying to use the data source object
(org.apache.struts.util.GenericDataSource) in the 20001128 build of struts
1.0 with the JDBC-ODBC bridge provider but am getting the following
exception:
java.lang.UnsupportedOperationException
at
sun.jdbc.odbc.JdbcOdbcConnection.getTypeMap(JdbcOdbcConnection.java:1432)
at
org.apache.struts.util.GenericConnection.(GenericConnection.java:116)
at
org.apache.struts.util.GenericDataSource.createConnection(GenericDataSource.
java:530)
at
org.apache.struts.util.GenericDataSource.open(GenericDataSource.java:468)
at
org.apache.struts.action.ActionServlet.initDataSource(ActionServlet.java:924
)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:410)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
at org.apache.tomcat.core.Handler.init(Handler.java:215)
at
org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:296)
at org.apache.tomcat.core.Handler.service(Handler.java:254)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
It appears that the getTypeMap() and setTypeMap() methods of
JdbcOdbcConnection throw an UnsupportedOperationException rather than a
SQLException. This happens in both jdk 1.2.2 and jdk 1.3 on Windows NT. In
GenericConnection.java SQLExceptions raised by these methods are simply
ignored so I have modified the class (attached) to also ignore
UnsupportedOperationExceptions and this seems to fix the problem. Can
anybody tell me if this is a sensible thing to do or does it just mask some
underlying problem?
Also it appears that the <data-source> element is required in
struts-config.xml rather than being optional. Is this intentional?
-------------------------------------------
Howard Moore
Senior Software Engineer
Datapulse CTI
Tel : +44 (0)1491 418000
Fax : +44 (0)1491 411459
E-mail: [EMAIL PROTECTED]
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept for
the presence of computer viruses.
**********************************************************************
GenericConnection.java