• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Search&sqlserver bug?

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep! Solution is here:

http://www.coderanch.com/t/575549

Thank you for asking!
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, did you solve this problem? I use sqlserver 2000 too, but I don't get this exception, when I search for "ALT".

You may need to download latest sqlserver.sql from CVS.
[originally posted on jforum.net by cagin]
 
What are you doing? You are supposed to be reading this tiny ad!
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!