posted 18 years ago
Hi,
when searching some words, fex. ALT, JForum throws exception Data truncation. Is it bug?
CVS 27/9/2005
sqlserver 2000
====================================
private void selectTopicData() throws Exception
{
PreparedStatement p = JForum.getConnection().prepareStatement(SystemGlobals.getSql("SearchModel.selectTopicData"));
p.setString(1, SessionFacade.getUserSession().getSessionId());
p.setString(2, SessionFacade.getUserSession().getSessionId());
p.executeUpdate();
p.close();
}
====================================
SearchModel.selectTopicData = INSERT INTO jforum_search_topics (topic_id, forum_id, topic_title, user_id, topic_time, \
topic_views, topic_status, topic_replies, topic_vote, topic_type, topic_first_post_id, topic_last_post_id, moderated, session, search_time) \
SELECT t.topic_id, t.forum_id, t.topic_title, t.user_id, t.topic_time, \
t.topic_views, t.topic_status, t.topic_replies, t.topic_vote, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.moderated, ?, GETDATE() \
FROM jforum_topics t, jforum_search_results s \
WHERE t.topic_id = s.topic_id \
AND s.session = ?
====================================
<!-- BEGIN ERROR STACK TRACE
<br /> java.lang.reflect.InvocationTargetException
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
<br /> at java.lang.reflect.Method.invoke(Method.java:585)
<br /> at net.jforum.Command.process(Command.java:113)
<br /> at net.jforum.JForum.service(JForum.java:183)
<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
<br /> at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
<br /> at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:345)
<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
<br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
<br /> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
<br /> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:383)
<br /> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
<br /> at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
<br /> at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
<br /> at java.lang.Thread.run(Thread.java:595)
<br /> Caused by: java.sql.DataTruncation: Data truncation
<br /> at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:378)
<br /> at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2754)
<br /> at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2195)
<br /> at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:620)
<br /> at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:483)
<br /> at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:445)
<br /> at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeUpdate(JtdsPreparedStatement.java:402)
<br /> at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
<br /> at net.jforum.dao.generic.GenericSearchDAO.selectTopicData(GenericSearchDAO.java:222)
<br /> at net.jforum.dao.generic.GenericSearchDAO.topicsByKeyword(GenericSearchDAO.java:212)
<br /> at net.jforum.dao.generic.GenericSearchDAO.search(GenericSearchDAO.java:77)
<br /> at net.jforum.view.forum.SearchAction.search(SearchAction.java:185)
<br /> ... 26 more
<br /> <br /> [originally posted on jforum.net by Anonymous]