Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: Accessing m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 10 Topic 3683 of 3784
Post > Topic >>

Re: Accessing mainframe DB2 in Java.

by Mark Space <markspace@[EMAIL PROTECTED] > Mar 22, 2008 at 09:36 PM

zalek wrote:
> Hello,
> 
> I am a mainframe Cobol programmer (yes - Cobol programmers are still
> around, mostly in caves) and I am writing a java code to access DB2.
> In a Cobol world after each SQL command we are checking for return
> conditions like success (sqlcode=0), not found (sqlcode = +100),
> duplicates (sqlcode=803) and more.
> How do you check for this conditions in Java?
> 
> Thanks,
> 
> Zalek

I'm going to guess:

I see SQLException has a constructor that takes a vendor specific return 
code ("vendorCode").  I think you'll have to either 1) parse the 
toString() result (or similar string result) or 2) use reflection to 
peek at the internal vendorCode variable.

Ugly as it is, I think the second method might actually be more reliable.
 




 10 Posts in Topic:
Accessing mainframe DB2 in Java.
zalek <zalekbloom@[EMA  2008-03-22 14:12:06 
Re: Accessing mainframe DB2 in Java.
=?ISO-8859-1?Q?Arne_Vajh=  2008-03-22 17:14:40 
Re: Accessing mainframe DB2 in Java.
zalek <zalekbloom@[EMA  2008-03-22 14:28:01 
Re: Accessing mainframe DB2 in Java.
=?ISO-8859-1?Q?Arne_Vajh=  2008-03-22 19:02:25 
Re: Accessing mainframe DB2 in Java.
Mark Space <markspace@  2008-03-22 16:42:58 
Re: Accessing mainframe DB2 in Java.
Mark Space <markspace@  2008-03-22 14:28:25 
Re: Accessing mainframe DB2 in Java.
Mark Space <markspace@  2008-03-22 21:36:42 
Re: Accessing mainframe DB2 in Java.
i.dont.need@[EMAIL PROTEC  2008-03-23 20:22:09 
Re: Accessing mainframe DB2 in Java.
Mickey <mickeyb@[EMAIL  2008-03-25 11:14:51 
Re: Accessing mainframe DB2 in Java.
Alex.From.Ohio.Java@[EMAI  2008-03-25 11:45:00 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 6:45:42 CDT 2008.