aspose file tools*
The moose likes XML and Related Technologies and the fly likes how to pass space to the database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to pass space to the database" Watch "how to pass space to the database" New topic
Author

how to pass space to the database

Arulkumar Gopalan
Ranch Hand

Joined: Oct 13, 2003
Posts: 104
Hi,
We don't have the data in xml for some not null columns. So we are getting the exception as 'null can not be inserted'. Then we decided to send spaces from the xml. but the parser throws null pointer exception.
How to send the spaces to the database.. ? any special tags are there?
we tried to use  . but it updates the database with '?'
Pls let me know if there is any solution for this.
Thanks.


Anbudan & Mahalo,<br />Arul<br /> <br />-Not a sun certified Java professional :-)
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
What tools/products are you using? In general, this sounds like a question for that particular vendor's forums.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Arulkumar Gopalan
Ranch Hand

Joined: Oct 13, 2003
Posts: 104
The proble is something like this.
We are inersting rows into a table where all the fields are not null. Since we don't have data for some columns in our xml, we have to update with spaces. For example see below.
<attribute1>name</attribute1>
<attribute2>empno</attribute2>
<attribute3></attribute3>
Here we don't have data for attribute3 in the xml tag. but attribute3 in the table is not null field. So we have to pass some value in the xml for attribute3. We are trying to send spaces. but if we give space the parser trims it and sends null to the database. so we are not able to update the attribute3 with spaces. Hope now the problem is clear. Any help regarding this is appreicated.
we are using Oracle xml parser.
Thanks.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Have you written the XML-to-whatever code yourself (with SAX or DOM) or is it some Oracle utility that does this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to pass space to the database
 
Similar Threads
URLyBird Database question
Exception handling in struts
problem in removing spaces in xml file
null pointer exceptiion
Mark Hansen - Document Literal Restrictions in WS 5.0