× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Database I/O
  • From: enord@xxxxxxxxxxxx
  • Date: Mon, 15 Nov 1999 12:16:48 -0600



Exactly.  I have a database file that is specified *NOT NULL I do not use a
default value.  When I try to use a JDBC sql statement it makes me pass a value.
The other problem is the fields are binary.  The actual definition is LONG
VARCHAR FOR BIT DATA.  The AS/400 creates this into a HEX 8128 field.  Java
tells me the best way to pass this is by using a InputStream object.  The
problem is I cannot figure out how to create a InputStream value which is null.
I was think that maybe I could populate this field using a direct database
connection and set those fields to null.  If you have a better idea, please
help.  I am ready for any suggestion.  If you have code examples would greatly
help.
Thank You
Erik Nord
Oriental Trading Company
Omaha, NE
enord@oriental.com








cujo@us.ibm.com on 11/12/99 03:22:32 PM

Please respond to JAVA400-L@midrange.com
                                                                                
                                                                                
                                                                                


                                                              
                                                              
                                                              
 To:      JAVA400-L@midrange.com                              
                                                              
 cc:      (bcc: Erik Nord/OTC)                                
                                                              
                                                              
                                                              
 Subject: Re: Database I/O                                    
                                                              








Is the problem here that you have created your tables to have columns that
are specified "NOT NULL WITH DEFAULT"?  If you use interactive SQL to
create tables, for example, the tables are created with this default.  This
will make it impossible to ever get a null value into the database table.
When you pass in null, the default value goes into the column instead of
the null.

If checking into this doesn't help, I can post JDBC examples setting
database columns to null and getting the null value back out if that would
help.


Regards,

Richard D. Dettinger
AS/400 Java Data Access Team

Think your job is safe?  Your future?  Your company's existence?  Think
again.
Right now there are people planning to do you in.  To replace you, steal
your
paycheck, obliterate your business, throw you out in the street.
..This is your wake-up call.  Digital Darwinism is unstoppable.
-Paul Somerson



enord@ORIENTAL.COM on 11/12/99 10:20:06 AM

Please respond to JAVA400-L@midrange.com

To:   JAVA400-L@midrange.com
cc:
Subject:  Database I/O






Can anyone give me examples of doing direct database IO's on the AS/400 via
Java?  My problem is populating a file that has a null capable field.
Everytime
I try to put a null into this field via a JDBC connection using SQL the
AS/400
places a '0' into it.  When I then run the application it errors out
because it
is expecting a null value.  I was really hoping by doing direct database
connection would solve this problem.  Any help would be greatly
appreciated.
Thank You
Erik Nord
Oriental Trading Company
Omaha, NE
enord@oriental.com





+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---



+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---






+---
| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.