Trouble Editing Data on iSeries from Web Application

pts.
Tags:
AS/400
DB2 Universal Database
Java
Hello. I'm having a problem editing data in a database file on my AS400. I have an application server set up on the same machine and I've created a data source to access the files in my library. The provider is "DB2 for OS400 V5R1 JDBC Provider", the database name is "*LOCAL" and the library name is correct. I can use a SELECT statement with the data source without issue, but when I try UPDATE, DELETE OR INSERT, I get an error message. This is my code to access the file: DataSource ds = (DataSource) (new InitialContext()).lookup("jdbc/<dataSourceName>"); Connection as400System = ds.getConnection("<userid>", "<password>"); This is my code to delete a record: PreparedStatement editRecordPS = as400System.prepareStatement("DELETE FROM <fileName> WHERE <condition>"); editRecordPS.execute(); Thanks in advance for your help. I appreciate it. I've listed the error from error log below: com.ibm.db2.jdbc.app.DB2DBException: <fileName> in <libraryName> not valid for operation. at java.lang.Throwable.<init>(Throwable.java:195) at java.lang.Exception.<init>(Exception.java:41) at java.sql.SQLException.<init>(SQLException.java:40) at com.ibm.db2.jdbc.app.DB2DBException.<init>(DB2DBException.java:47) at com.ibm.db2.jdbc.app.DB2PreparedStatementRuntimeImpl.SQLExecute(Native Method) at com.ibm.db2.jdbc.app.DB2PreparedStatementRuntimeImpl.execute(DB2PreparedStatementRuntimeImpl.java:236) at com.ibm.db2.jdbc.app.DB2PreparedStatement.execute(DB2PreparedStatement.java:1822) at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.execute(WSJdbcPreparedStatement.java:400) at PresentationEdit.doPost(PresentationEdit.java:78) 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(StrictServletInstance.java:110) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174) at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1038) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:603) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204) at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125) at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286) at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71) at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:449)

Answer Wiki

Thanks. We'll let you know when a new response is added.

I know this is simple and is most likely not the solution but have you checked the profiles authority to the objects?

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Is the file journaled? If not, then the error is probably what you should see. You may have the connection defined under commitment control and need to turn it off. (It should be on, which means journaling should be established.) Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following