Variable Length Field with DB2?400
Folks, We use OJB as the data access bridge to access DB2/400 data in our Web application. In some of our DB2/400 tables, we define the variable length field, such as VARCHAR(4096) which allow up to 4096 characters. We use the following field definition in OJB, But, when try to insert record, "Data truncated" error received with the String length only about 160. If the String length is short, we do not have the problem. Any suggestion or advices? Thank you very much "Jay" Jie Xu This message and any included attachments are from Siemens Medical Solutions and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to [EMAIL PROTECTED] Thank you
RE: FW: Variable Length Field with DB2?400
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown Source) at com.siemens.med.hs.ms4.oc_file.dao.OcpmaltDAO.insert(OcpmaltDAO.java:49) at com.siemens.med.hs.ms4.oc_file.dao.DrugAlertsDAO.insertAlert(DrugAlertsD AO.java:151) at com.siemens.med.hs.ms4.orders.OrderAlertProcess.writeAlertFiles(OrderAle rtProcess.java:2208) at com.siemens.med.hs.ms4.portal.actions.WellAction.sendOrders(WellAction.j ava:2331) at com.siemens.med.hs.ms4.portal.actions.WellAction.execute(WellAction.java :1061) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictSe rvletInstance.java:110) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLi fecycleServlet.java:174) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycle Servlet.java:313) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLif ecycleServlet.java:116) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance. java:283) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(Vali dServletReferenceState.java:42) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(Servle tInstanceReference.java:40) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh ain.java:76) at com.siemens.med.hs.ms4.filters.SessionFilter.doFilter(SessionFilter.java :291) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInst anceWrapper.java:132) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterCh ain.java:71) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispa tch(WebAppRequestDispatcher.java:974) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRe questDispatcher.java:564) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppReq uestDispatcher.java:200) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:1 19) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInv oker.java:276) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocati on(CachedInvocation.java:71) at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invo ke(CacheableInvocationContext.java:116) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(Servle tRequestProcessor.java:186) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSELis tener.java:334) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection .java:56) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java: 618) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java) "Jay" Jie Xu Siemens MED Office: 801-539-4642 Mobile: 801-856-4402 Fax: 801-533-8004 -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Monday, November 27, 2006 6:11 PM To: OJB Users List Subject: Re: FW: Variable Length Field with DB2?400 Hi Jay, Xu, Jie (MED US) wrote: > Folks, > > > We use OJB as the data access bridge to access DB2/400 data in our Web > application. In some of our DB2/400 tables, we define the variable > length field, such as VARCHAR(4096) which allow up to 4096 characters. > We use the following field definition in OJB, > > > > > id="7" > > > name="screenMsg" > > > column="ALMSGT" > > > jdbc-type="VARCHAR" > > length="4096" > > /> > > But, when try to insert record, "Data truncated" error received with the > String length only about 160. If the String length is short, we do not > have the problem. Any suggestion or advices? > OJB doesn't truncate any String objects. I think this is a jdbc-driver or DB table issue. Did you checked the DB table, is the column really VARCHAR(4096)? Could you post stack trace? regards, Armin > > Thank
Re: FW: Variable Length Field with DB2?400
Hi Jay, Xu, Jie (MED US) wrote: Folks, We use OJB as the data access bridge to access DB2/400 data in our Web application. In some of our DB2/400 tables, we define the variable length field, such as VARCHAR(4096) which allow up to 4096 characters. We use the following field definition in OJB, But, when try to insert record, "Data truncated" error received with the String length only about 160. If the String length is short, we do not have the problem. Any suggestion or advices? OJB doesn't truncate any String objects. I think this is a jdbc-driver or DB table issue. Did you checked the DB table, is the column really VARCHAR(4096)? Could you post stack trace? regards, Armin Thank you very much "Jay" Jie Xu This message and any included attachments are from Siemens Medical Solutions and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to [EMAIL PROTECTED] Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Variable Length Field with DB2?400
Folks, We use OJB as the data access bridge to access DB2/400 data in our Web application. In some of our DB2/400 tables, we define the variable length field, such as VARCHAR(4096) which allow up to 4096 characters. We use the following field definition in OJB, But, when try to insert record, "Data truncated" error received with the String length only about 160. If the String length is short, we do not have the problem. Any suggestion or advices? Thank you very much "Jay" Jie Xu This message and any included attachments are from Siemens Medical Solutions and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to [EMAIL PROTECTED] Thank you