File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Inserting arrays into database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Inserting arrays into database" Watch "Inserting arrays into database" New topic
Author

Inserting arrays into database

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
My DB tables (Oracle XE)



I am unable to insert record into database properly


It inserts record like this:


Why it inserts the null record into db?

Thanks in anticipation

Best regards
Peter Taucher
Ranch Hand

Joined: Nov 18, 2006
Posts: 174
Define 'properly'. -> TellTheDetails


Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

My guess is you have empty valeus in your arrays.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Paul Sturrock wrote:My guess is you have empty valeus in your arrays.


Thanks for your favorable reply

Yes, you are right why its getting empty values?

Best regards
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Paul Sturrock wrote:My guess is you have empty valeus in your arrays.


Still waiting for reply
Peter Taucher
Ranch Hand

Joined: Nov 18, 2006
Posts: 174
You want 'us' to tell 'you' why your data isn't filled? Don't you think that could be difficult without knowing your code or such?
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Farakh khan wrote:
Paul Sturrock wrote:My guess is you have empty valeus in your arrays.


Still waiting for reply


Where do you check for null values in your code ??

The only check I can see in the code, is the one below - and it only checks for empty Strings.


Regards, Rene Larsen
Dropbox Invite
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Farakh khan wrote:
Paul Sturrock wrote:My guess is you have empty valeus in your arrays.


Thanks for your favorable reply

Yes, you are right why its getting empty values?

Best regards


You'd have to tell us that. From your code, we can't see where the array's speak, read and write are populated, but the data inserted in suggests they have emtpy valeus in them.
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Thanks the problem solved

best regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inserting arrays into database
 
Similar Threads
How to call procedure in JDBC
Search query is taking too long to search
java.lang.NullPointerException
Displaying record not exists
Date Comparison in Java