Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    3

    Unanswered: db2 connect from server to VM

    Hi,

    I am very new to db2 & VM. I am trying to insert into the db2 in VM from a server via db2 connect. I have the following error message when the insert is run from a Java program.

    INSERT INTO LMSFWS01.FWSCNTRL VALUES ( 'GSAA', 159, 0, 0, 20031119, 182829, 20031119, 182829, 'IBMAusCredHQ01', ' ' , 0 , 0 , ' ' )
    19/11/2003 18:28:31 COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][SQLDS/VM] SQL0552N "LMSFWS01" does not have the privilege to perform operation "FO02". SQLSTATE=42502

    However, I would be able to run the same insert successfully via a db2 connect window from the server side.

    Would anyone be able to give me a bit of hint.

    Cheers,

  2. #2
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    You are probably accessing the VM database with two different users IDs. Check if the same user id is used.

    The error message says: "User ID LMSFWS01 does not have permission to do the task".

    1. Does LMSFWS01 user exist?
    2. Does the user have the permission to do the task?

    Hope this helps,
    Grofaty

  3. #3
    Join Date
    Nov 2003
    Posts
    3
    Originally posted by grofaty
    Hi,

    You are probably accessing the VM database with two different users IDs. Check if the same user id is used.

    The error message says: "User ID LMSFWS01 does not have permission to do the task".

    1. Does LMSFWS01 user exist?
    2. Does the user have the permission to do the task?

    Hope this helps,
    Grofaty

    Hi Grofaty,

    Tks for the reply.

    Your suggestion is what I guess in the beginning. Then I grant dba to the user "LMSFWS01' & the message change to the following.

    INSERT INTO LMS.FWSCNTRL VALUES ( 'GSAA', 159, 0, 0, 20031118, 221022, 20031118, 221022, 'IBMAusCredHQ01', ' ' , 0 , 0 , ' ' )
    18/11/2003 10:10:59 PM COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][SQLDS/VM] SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "68". SQLSTATE=40001

    Now I believe this message doesn't reflex the real situation since I can run the insert sql via db2 connect directly without problem.

    Do u have more idea pls?

  4. #4
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    You have solved your problem with access rights. That is good news. Now you have problem with locking.

    1. Have you tried to execute this SQL more than one time? Somebody has locked your table and after a time the locks could be released. So try this more than one time - just wait couple of secounds.
    2. Do you "via command window" make commits? It looks like somebody locks the table and does not release locks from it. Please try to write "commit" on command window to release locks. This probably will not help, but just try.
    3. Does your java application makes "commit" after insert statement? Check this out. If doesn't then make commit. The difference between command window and java application is that command windows makes auto-commit after each command (this is default setting and can be changed). On the other hand java application does not make auto-commit, so you have to explicitly define commit statement.

    Hope this helps,
    Grofaty

  5. #5
    Join Date
    Nov 2003
    Posts
    3
    Hi Grofaty,

    Tks for the reply again. Problem solved. Just to share with u. It has nothing related to access privilage, timeout or locking. What I did is I bind all the binding I can find under the db2 connect "Application Binding". Before I just bind the vm one and finally I bind all the binding like mvs, as400 ...
    Problem has been solved however I'm not sure by doing that whether it will give a -ve implact to the system catalog.

    What do u think?




    Originally posted by grofaty
    Hi,

    You have solved your problem with access rights. That is good news. Now you have problem with locking.

    1. Have you tried to execute this SQL more than one time? Somebody has locked your table and after a time the locks could be released. So try this more than one time - just wait couple of secounds.
    2. Do you "via command window" make commits? It looks like somebody locks the table and does not release locks from it. Please try to write "commit" on command window to release locks. This probably will not help, but just try.
    3. Does your java application makes "commit" after insert statement? Check this out. If doesn't then make commit. The difference between command window and java application is that command windows makes auto-commit after each command (this is default setting and can be changed). On the other hand java application does not make auto-commit, so you have to explicitly define commit statement.

    Hope this helps,
    Grofaty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •