How to write into file from xml dom Object
Hello,
I try to transform my xml DOM document object into
file. I try the following:
try {
// Prepare the DOM document for writing
DOMSource source = new DOMSource(newDoc);
// Prepare the output file
File file = new File(myHomeRep + "btLom.xml");
StreamResult result = new StreamResult(file);
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
} catch (TransformerConfigurationException e) {
} catch (TransformerException e) {
But my file is empty.
I do it with some wel formed xml tree document, thus I am certain
that the xml tree exists.
Could you explane me please what I am doeing wrong,
or is there are some possibility to make from my xml dom object
a file.
In advance much thanks,
Julia
Here's one thing you are doing wrong:} catch (TransformerConfigurationException e) {
} catch (TransformerException e) {
}With this code, if an exception occurs then you are guaranteed to know nothing about it. At the minimum do this:} catch (TransformerConfigurationException e) {
e.printStackTrace();
} catch (TransformerException e) {
e.printStackTrace();
}
Similar Messages
-
How to generate .java file from xml?
Does anyone have an idea of how i can generate .java file from xml file? Tools like jakrata digester, JOX are there but both of them are useful in populating java beans from xml. My requirement is to generate .java file from .xml with getters and setters methods for xml elements/attributes. I also tried JAXB. But JAXB generates bunch of files and most of them are interfaces, which is not going to work for me.
For e.g. i have following xml file and i want to generate Address.java file with getters/setters. Any ideas?
<?xml version='1.0' encoding='UTF-8' ?>
<Address>
<FirstName type="String"/>
<PoBox type="int"/>
</Address>
Thanks,
VickyCrosspost.
http://forum.java.sun.com/thread.jsp?thread=475564&forum=4&message=2205846 -
Nullpointer exception while multiple users reading from XML DOM object
We are getting a null pointer exception when we are trying to read from a Static XML DOM object . We are getting the exception in weblogic 7.1 very rarely but started getting the exception in weblogic 9.2 more frequently. When multiple users are trying to access the Static variable we are getting null pointer exception. I think it is a memory related issue. Making the whole method synchronized is resolving the issue. But that is not the right thing to do. Can any one know what might be the issue here?
I am giving the code and the XML. I have tried to give the latest Xerces parser from the Apache site but got the same exception. Please help me in this regard.
The XML is also provided below along with the code.
package com.test;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.util.ArrayList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
//import org.apache.xml.serialize.XMLSerializer;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
public class ObjectPersistanceXMLParser {
public static volatile Document configXML;
* @param objectName
* @param attributeName
* @return
* @throws Throwable
public static ArrayList getData(String objectName,String attributeName) throws Exception
Node ndDoc = getXMLDoc();
Node ndRoot = ndDoc.getFirstChild();
NodeList ndFirstList = ndRoot.getChildNodes();
BeanInfo bi = Introspector.getBeanInfo(ndFirstList.getClass());
System.out.println("****** "+bi.getBeanDescriptor().getBeanClass().getName());
System.out.println("This is the number of child nodes present:"+ndFirstList.getLength()+":::"+ndFirstList.item(0).getNodeValue());
ArrayList returnResult = null;
String strReturnResult = null;
for(int i=0;i<ndFirstList.getLength();i++)
if(ndFirstList.item(i).getNodeName().equals("ObjectDBMapping"))
NodeList ndObjectList = ndFirstList.item(i).getChildNodes();
for(int j=0;j<ndObjectList.getLength();j++)
if(ndObjectList.item(j).getNodeName().equals("Object"))
if(ndObjectList.item(j).getAttributes().getNamedItem("NAME").getNodeValue().equalsIgnoreCase(objectName))
NodeList ndFieldList = ndObjectList.item(j).getChildNodes();
for(int k=0;k<ndFieldList.getLength();k++)
if(ndFieldList.item(k).getNodeName().equals("field"))
if(ndFieldList.item(k).getAttributes().getNamedItem("NAME").getNodeValue().equalsIgnoreCase(attributeName))
returnResult = new ArrayList();
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("SOURCE_TABLE").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("SOURCE_COLUMN").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("TYPE").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PERSIST").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("DEFAULT_VALUE").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PRIMARY_KEY").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("VERSIONABLE").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PRECISION").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("FOREIGN_KEY").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PARENT_TABLE").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("PARENT_COLUMN").getNodeValue());
returnResult.add(ndFieldList.item(k).getAttributes().getNamedItem("LEVEL").getNodeValue());
//return returnResult;
if(strReturnResult == null){
System.out.println("This is the current state of dom: ");
//printDom((Document)ndDoc);
if(!attributeName.trim().equalsIgnoreCase("class") &&
!attributeName.trim().equalsIgnoreCase("operationFlag")&&
!attributeName.trim().equalsIgnoreCase("primaryKeyColumnName")&&
!attributeName.trim().equalsIgnoreCase("tableName"))
System.out.println("No DB Mapping found for Object "+objectName+" and attribute "+attributeName);
return returnResult;
* @param objectName
* @param tableName
* @return
* @throws Throwable
public static int getMaxFields(String objectName,String tableName) throws Throwable
Node ndDoc = getXMLDoc();
Node ndRoot = ndDoc.getFirstChild();
NodeList ndFirstList = ndRoot.getChildNodes();
int returnResult = 0;
for(int i=0;i<ndFirstList.getLength();i++)
if(ndFirstList.item(i).getNodeName().equals("ObjectDBMapping"))
NodeList ndObjectList = ndFirstList.item(i).getChildNodes();
for(int j=0;j<ndObjectList.getLength();j++)
if(ndObjectList.item(j).getNodeName().equals("Object"))
if(ndObjectList.item(j).getAttributes().getNamedItem("NAME").getNodeValue().equalsIgnoreCase(objectName))
NodeList ndFieldList = ndObjectList.item(j).getChildNodes();
for(int k=0;k<ndFieldList.getLength();k++)
if(ndFieldList.item(k).getNodeName().equals("field"))
if(ndFieldList.item(k).getAttributes().getNamedItem("SOURCE_TABLE").getNodeValue().equalsIgnoreCase(tableName) &&
ndFieldList.item(k).getAttributes().getNamedItem("PERSIST").getNodeValue().equalsIgnoreCase("Y"))
returnResult++;
return returnResult;
/*This method returns a Document Object of the ObjectConfig.xml file. This method is separated
* out from the calling method to keep an option OPEN in case it is later decided to read XML
* from memory instead of physical location.*/
public static Document getXMLDoc() throws Exception
if(configXML == null)
synchronized (ObjectPersistanceXMLParser.class)
if(configXML == null)
if(System.getProperty("OBJECT-CONFIG-XML") == null){
System.out.println("System Property OBJECT-CONFIG-XML not found");
String filePath = System.getProperty("OBJECT-CONFIG-XML");
System.out.println("Reading CONFIG Xml from file - "+filePath);
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
BeanInfo bi = Introspector.getBeanInfo(docBuilderFactory.getClass());
System.out.println("****** "+bi.getBeanDescriptor().getBeanClass().getName());
try
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
configXML = docBuilder.parse(filePath);
}catch(Throwable t)
int errorCode = 111;
String errorMsg = "Problem in parsing OBJECT-CONFIG-XML file";
System.out.println(errorMsg);
else
System.out.println("Config XML Loaded from memory.....new");
return configXML;
public static void main(String args[]) throws Throwable
/*public synchronized static void printDom(Document doc){
XMLSerializer ser = new XMLSerializer(System.out, null);
try {
ser.serialize(doc);
} catch (Throwable e) {
e.printStackTrace();
System.out.flush();
<?xml version="1.0"?><root>
<ObjectDBMapping>
<Object NAME="com.los.common.entity.LoanTask">
<field NAME="loanTaskId" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="LOAN_TASK_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
VERSIONABLE="Y" FOREIGN_KEY="N" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="taskId" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="TASK_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="Y" PARENT_TABLE="UWM_TASK_MASTER" PARENT_COLUMN="TASK_ID">
</field>
<field NAME="taskName" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="TASK_NAME" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="taskStatus" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="TASK_STATUS" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="taskCreationDate" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="TASK_CREATION_DATE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="taskClosureDate" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="TASK_CLOSURE_DATE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="taskClosedBy" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="TASK_CLOSED_BY" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="updatedDate" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="UPDATED_DATE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="updatedBy" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="UPDATED_BY" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="createdDate" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="CREATED_DATE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="createdBy" SOURCE_TABLE="UW_LOAN_TASKS"
SOURCE_COLUMN="CREATED_BY" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
</Object>
<Object NAME="com.los.common.entity.LOSUnderwritingRules">
<field NAME="undwRunRuleId" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="UNDW_RUN_RULE_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="underwritingRunNo" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="UNDERWRITING_RUN_NO" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="underwritingRunId" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="UNDERWRITING_RUN_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="ruleGroup" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="RULE_GROUP" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="ruleName" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="RULE_NAME" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="messageCode" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="MESSAGE_CODE" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="messageText" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="MESSAGE_TEXT" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="passFail" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="PASS_FAIL" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="overrideAuthorityLevel" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="OVERRIDE_AUTHORITY_LEVEL" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="overrideYN" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="OVERRIDE_Y_N" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="overrideBy" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="OVERRIDE_BY" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="overrideOn" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="OVERRIDE_ON" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="createdBy" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="CREATED_BY" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="updatedBy" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="UPDATED_BY" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="createdDate" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="CREATED_DATE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="updatedDate" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="UPDATED_DATE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="processName" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="PROCESS_NAME" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="overrideReason" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="OVERRIDE_REASON" TYPE="VARCHAR2" LENGTH="1000"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="messageModule" SOURCE_TABLE="UW_UNDERWRITING_RULES"
SOURCE_COLUMN="MESSAGE_MODULE" TYPE="VARCHAR2" LENGTH="30"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
</Object>
<Object NAME="com.los.common.entity.Applicant">
<field NAME="applicantId" SOURCE_TABLE="UW_APPLICANT_MASTER"
SOURCE_COLUMN="APPLICANT_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="registrationNumber" SOURCE_TABLE="UW_APPLICANT_MASTER"
SOURCE_COLUMN="REGISTRATION_NUMBER" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="cifNumber" SOURCE_TABLE="UW_APPLICANT_MASTER"
SOURCE_COLUMN="CIF_NUMBER" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="customerStatus" SOURCE_TABLE="UW_APPLICANT_MASTER"
SOURCE_COLUMN="CUSTOMER_STATUS" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="customerType" SOURCE_TABLE="UW_APPLICANT_MASTER"
SOURCE_COLUMN="CUSTOMER_TYPE" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="N" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantLastName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="APPLICANT_LAST_NAME" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantFirstName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="APPLICANT_FIRST_NAME" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantMiddleName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="APPLICANT_MIDDLE_NAME" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantNameSuffix" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="APPLICANT_NAME_SUFFIX" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="nationality" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="NATIONALITY" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="age" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="AGE" TYPE="NUMBER" LENGTH="5"
PRECISION="2" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="dateOfBirth" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="DATE_OF_BIRTH" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="identificationType1" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="IDENTIFICATION_TYPE1" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="identificationType2" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="IDENTIFICATION_TYPE2" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="identificationType" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="IDENTIFICATION_TYPE" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="identificationNumber1" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="IDENTIFICATION_NUMBER1" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="identificationNumber2" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="IDENTIFICATION_NUMBER2" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="identificationNumber" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="IDENTIFICATION_NUMBER" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="guarantorIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="GUARANTOR_INDICATOR" TYPE="VARCHAR2" LENGTH="50"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="separateCobDisclosureRequir" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="SEPARATE_COB_DISCLOSURE_REQUIR" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="domesticRisk" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="DOMESTIC_RISK" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="crossBorderRisk" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="CROSS_BORDER_RISK" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="title" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="TITLE" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="previousSurname" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="PREVIOUS_SURNAME" TYPE="VARCHAR2" LENGTH="50"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="legalName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="LEGAL_NAME" TYPE="VARCHAR2" LENGTH="200"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="preferredName" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="PREFERRED_NAME" TYPE="VARCHAR2" LENGTH="50"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="gender" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="GENDER" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="seniorCitizenStatus" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="SENIOR_CITIZEN_STATUS" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="staffIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="STAFF_INDICATOR" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="warVeteranIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="WAR_VETERAN_INDICATOR" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="noOfDependants" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="NO_OF_DEPENDANTS" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="maritalStatus" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="MARITAL_STATUS" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="educationStatus" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="EDUCATION_STATUS" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="detApplicantId" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="APPLICANT_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="Y" PARENT_TABLE="UW_APPLICANT_MASTER" PARENT_COLUMN="APPLICANT_ID">
</field>
<field NAME="detApplicantDetailId" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="APPLICANT_DETAIL_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="Y"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="usResidentIndicator" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="US_RESIDENT_INDICATOR" TYPE="VARCHAR2" LENGTH="1"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="employeeNumber" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="EMPLOYEE_NUMBER" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="isdefaulter" SOURCE_TABLE="UW_APPLICANT_DETAILS"
SOURCE_COLUMN="ISDEFAULTER" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="2" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
</Object>
<Object NAME="com.los.common.entity.ApplicantContact">
<field NAME="applicantId" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="APPLICANT_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="Y" PARENT_TABLE="UW_APPLICANT_MASTER" PARENT_COLUMN="APPLICANT_ID">
</field>
<field NAME="contactId" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="CONTACT_ID" TYPE="NUMBER" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="Y"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="addressType" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="ADDRESS_TYPE" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantAddressLine1" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_1" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantAddressLine2" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_2" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantAddressLine3" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_3" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantAddressLine4" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="APPLICANT_ADDRESS_LINE_4" TYPE="VARCHAR2" LENGTH="100"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="residingSince" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="RESIDING_SINCE" TYPE="DATE" LENGTH=""
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="residentialStatus" SOURCE_TABLE="UW_APPLICANT_CONTACT_INFO"
SOURCE_COLUMN="RESIDENTIAL_STATUS" TYPE="VARCHAR2" LENGTH="20"
PRECISION="" PERSIST="Y" LEVEL="1" DEFAULT_VALUE="" PRIMARY_KEY="N"
VERSIONABLE="Y" FOREIGN_KEY="" PARENT_TABLE="" PARENT_COLUMN="">
</field>
<field NAME="applicantEMaCould you please provide the stack trace?
-
How to Write a file from hex format to another format
hi I am trying to create a file (IBM AFP-printer format) from the hex file which i have created after reading that IBM afp file. Now i have to do some changes in that hex file data and store it back to the same format.
I have tryed storing it using:
Writer out = new OutputStreamWriter(outputStream,"Cp1252");
but it is taking hex format only.
I have checked encoding of afp file by this code
File inputFile = new File( "C:\\ACode\\new2.afp" ) ;
FileInputStream inputStream = new FileInputStream(inputFile );
InputStreamReader in = new InputStreamReader(inputStream);
System.out.println(in.getEncoding());
it is showing Cp1252 only.
But i am unable to store it back to same format
ThanksI don't really know what the IBM APF stream format is, but I suspect that your approach is not right. If you really want to read and write raw hex bytes, then do not use readers and writers; instead use pure streams. The reason is that readers and writers are designed to deal with character-oriented data, and will automatically perform translations on input and output.
On the other hand, if you could find the correct encoding/decoding software for the IBM format in question, well then readers/writers would be fine, and you could do all of your "internal" work in unicode. -
How to generate .PRN file from a ReportDocument object in Crystal Reports 10.
Hi,
I have reports created in Crystal 10 version. From the VB .Net code I am able to load the report to ReportDocument object and able to print it to the local printer. Now I need to generate .PRN file of the report for faxing purpose.
Can anyone help me one this?.
Thanks,
Srini.Hi Joanne,
Boxes do not actually have a 'name'. When you add a Box in a report, it will be called 'Box 1' by default. And the only place this name is visible is under the Report Explorer.
Or do you mean to say 'Text Object'?
-Abhilash -
How to store xml data into file in xml format through java program?
HI Friends,
Please let me know
How to store xml data into file in xml format through java program?
thanks......
can discuss further at messenger.....
Avanish Kumar Singh
Software Engineer,
Samsung India Development Center,
Bangalore--560001.
[email protected]Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
i got a piece of code from the net which allows me to parse th file:
import java.io.IOException;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import org.apache.xerces.parsers.SAXParser;
import java.lang.*;
public class MySaxParser extends DefaultHandler
private static int INDENT = 4;
private static String attList = "";
public static void main(String[] argv)
if (argv.length != 1)
System.out.println("Usage: java MySaxParser [URI]");
System.exit(0);
String uri = argv[0];
try
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
MySaxParser MySaxParserInstance = new MySaxParser();
parser.setContentHandler(MySaxParserInstance);
parser.parse(uri);
catch(IOException ioe)
ioe.printStackTrace();
catch(SAXException saxe)
saxe.printStackTrace();
private int idx = 0;
public void characters(char[] ch, int start, int length)
throws SAXException
String s = new String(ch, start, length);
if (ch[0] == '\n')
return;
System.out.println(getIndent() + " Value: " + s);
public void endDocument() throws SAXException
idx -= INDENT;
public void endElement(String uri, String localName, String qName) throws SAXException
if (!attList.equals(""))
System.out.println(getIndent() + " Attributes: " + attList);
attList = "";
System.out.println(getIndent() + "end document");
idx -= INDENT;
public void startDocument() throws SAXException
idx += INDENT;
public void startElement(String uri,
String localName,
String qName,
Attributes attributes) throws SAXException
idx += INDENT;
System.out.println('\n' + getIndent() + "start element: " + localName);
if (localName.compareTo("Machine") == 0)
System.out.println("YES");
if (attributes.getLength() > 0)
idx += INDENT;
for (int i = 0; i < attributes.getLength(); i++)
attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
if (i < (attributes.getLength() - 1))
attList = attList + ", ";
idx-= INDENT;
private String getIndent()
StringBuffer sb = new StringBuffer();
for (int i = 0; i < idx; i++)
sb.append(" ");
return sb.toString();
}// END PRGM
Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
The next step is to write the data to the DB.
Am sending an example of my file:
<Start>
<Machine>
<Hostname> IPCServer </Hostname>
<HostID> 80c04499 </HostID>
<MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
<CPU> UltraSPARC-IIi at 360 MHz </CPU>
<Memory> RAM : 512 MB </Memory>
<HostAdapter>
<HA> kern.info] </HA>
</HostAdapter>
<Harddisks>
<HD>
<HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
<HD2> ST38420A 8.2 GB </HD2>
</HD>
</Harddisks>
<GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
<NetworkType> hme0 : Fast-Ethernet </NetworkType>
<EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
<IPAddress> 149.51.23.140 </IPAddress>
</Machine>
</Start>
Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
Cal u tellme what to do!
Even better- do u have a piece of code that will help me understand and implement the database writing portion?
I badly need help here.
THANX -
How to create an Excel file from XML in the Receiver File Adapter Comm Ch
How do I create an Excel file from XML in the Receiver File Adapter Communication Channel? I have my mapping done and I am outputting the file as a comma delimited csv file. However, the target can only process an Excel file (.xls). How can I generate an Excel in XI?
I saw this blog, but I don't know how to create a XSLT transformation.
/people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
Any help would be appreciated. Thanks.Here are the steps I took to create an XSLT transformation in XI 3.0:
1. I created my source and target XSDs using XMLSpy.
2. I created the XSLT mapping from source to target in XMLSpy (referencing the souce XSD schema).
3. I created another XSLT mapping to format the target into Excel XML.
4. Import the source and target XSDs in the IR's External Definitions
5. Zip each XSLT mapping (.xls) and import it into the IR's Imported Archives
6. Reference the XSL mappings in the Interface Mapping -
How to download a file from the net and save it into .txt format in a datab
Can some one show me a tutorial on how to download a file from the net and save it into .txt format in a database?
Thank you,http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html
-
Generate an XML file from a DOM tree
Hi,
I'm trying to generate an XML file from a DOM tree that I obtained from another XML file with the Xerces library. I used the following operation :
public static void writeXmlFile(Document doc, String filename) {
try {
Source source = new DOMSource(doc);
File file = new File(filename);
Result result = new StreamResult(file);
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(source, result);
} catch (TransformerConfigurationException e) {
System.err.println(e);
System.exit(1);
} catch (TransformerException e) {
System.err.println(e);
System.exit(1);
But I have this Windows/Linux problem. When I execute this on Windows, everything is correct. But if I try on Linux (every distribution does the same thing), I obtain an XML file where everything is written on just ONE LINE : there is neither identation nor carriage return at the end of a line ... And that is pretty annoying 'cause I need to SEE what I generate ...
Thanks for your answer,
Blueberryfin.Actually I would think that no indents and no new-lines would be more correct, but maybe it's an option for parsers to do it either way if you don't specify it. If you want to specify it, look at this post from last month:
http://forum.java.sun.com/thread.jsp?forum=34&thread=383400 -
HELP!!!!!! - How to write into a file?
How to write into a file?
I want to make a script that will connect(not enter) to my website[for example, www.vasa.com] every time i connect to the internet.
Now i have 3 problems:
1. i dont know how to write into a file
2. i dont know how to make it connect to my 'server' without entering the website
3. i dont know what file to write it to
so if someone can help me, please do.Well, how about RTFM?? In this case that can be found here:
http://developer.java.sun.com/developer/onlineTraining/
BTW - these things have been asked azillion times, search the forum. -
How to create Inbound Idoc from XML file-Need help urgently
Hi,
can any one tell how to create inbound Idoc from XML file.
we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml' we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
Please let me know the process to trigger inbound Idoc with out using XI and any other components.
Thanks in advance
Dora ReddyHi .. Did either of you get a result on this?
My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
I see lots of mention of using a Function Module.
Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
Or is there something tht can be done with Standard SAP?
Thanks
Lee -
hi, i purchased a 2 dvd digital set. i cant just download it straight to my ipad. they said i have to down load it to my i tunes, then can transfer to i pad. im not seeing how to click the files from my email, and get them into the i tunes acct... ugh.
i do not have a mac home pc. just a regular pcI had the same problem after I gave my old iPad to my parents and tried to install Netflix. This is what you have to do: Open iTunes on your computer, the one you sync your iPad to. Then go to iTunes Store and search for and download Netflix app. After you download it, if your iPad is set to download new purchases it may start downloading on your iPad. If so, tap and hold to delete the app (because it is trying to install the new version on the iPad) Next step, go to the App Store on your iPad and find Netflix and it should say install since you already purchased it on the computer. Tap to install, and it will say the version is not compatible, tap to download a previous version. Click that and it will install the older version! One more thing, if and when you sync to your computer again it will say something like " Unable to install Netflix on your iPad" Just click the box to never remind you again, because it's trying to sync the newer Netflix app to your iPad, but it doesn't work so it displays the message. The old app will remain on the ipad. Hope this helps, good luck
-
How do I open files from an external drive? It's plugged into the second slot to the end. Did I plug it into the right place and how do I find the drive when trying to attach a file in an email?
Files on an external hard drive open just like files on the internal drive - but I get the idea that you are having a problem just finding and seeing those files. Is that correct?
What operating system is running on your MacBook? -
How do I create a Powerpoint file from XML?
Good afternoon everyone,
I've used Apache FOP to create PDF files from XML before, and that works great.
Is anyone aware of a similar tool or means of creating a PowerPoint file? Any open-source packages out there that I can use? Any standard sun classes I missed? Any code snippets available? Anything?
Thanks tons!
-ScottMS says that it will be using XML for everything from now on. (but we all know MS) So I suppose it should be possible to convert to PP from XML, however I think you will have a hard time finding a Java implementation from either Sun or MS (they don't like each other)
-
How to insert the data from XML to a table
Hi,
I'm using Oracle 10g Express Edition
I need help in How to insert the data from XML file into the table.
Below is the example i'm working on..
I have create ridb user with below mentioned privileges:
Account Status Locked Unlocked
Default Tablespace: USERS
Temporary Tablespace: TEMP
User Privileges :
Roles:
CONNECT
RESOURCE
Direct Grant System Privileges:
CREATE DATABASE LINK
CREATE MATERIALIZED VIEW
CREATE PROCEDURE
CREATE PUBLIC SYNONYM
CREATE ROLE
CREATE SEQUENCE
CREATE SYNONYM
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
CREATE VIEW
& table is created TRIALZIPCODES below mentioned is the DDL:
CREATE TABLE TRIALZIPCODES
STATE_ABBR VARCHAR2(20) NOT NULL
, ZIP_CODE NUMBER(10, 0) NOT NULL
, ZIP_CODE_EXT VARCHAR2(20)
Below is the XML FILE: which is stored in C:\OracleProject Folder
File name: trial.xml
<?xml version="1.0" ?>
<metadata>
- <Zipcodes>
- <mappings Record="4">
<STATE_ABBREVIATION>CA</STATE_ABBREVIATION>
<ZIPCODE>94301</ZIPCODE>
</mappings>
- <mappings Record="5">
<STATE_ABBREVIATION>CO</STATE_ABBREVIATION>
<ZIPCODE>80323</ZIPCODE>
<ZIP_CODE_EXTN>9277</ZIP_CODE_EXTN>
</mappings>
</Zipcodes>
</metadata>
PL/SQL Procedure:which i'm trying to execute from SQLDeveloper
create or replace
PROCEDURE TRIAL AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
begin
-- DBMS_XMLGEN.setRowTag ( ctx IN ctxHandle, rowTag IN VARCHAR2);
-- DBMS_XMLGEN.setRowSetTag ( ctx IN ctxHandle, rowSetTag IN VARCHAR2);
-- the name of the table as specified in our DTD
DBMS_XMLGEN.SETROWSETTAG(l_context_handle,'zipcodes');
-- the name of the data set as specified in our DTD
DBMS_xmlgen.setRowTag(l_context_handle,'mappings');
-- for getting the output on the screen
dbms_output.enable(1000000);
-- open the XML document in read only mode
v_FileHandle := utl_file.fopen('c:/OracleProject','trial.xml', 'r');
loop
BEGIN
utl_file.get_line(v_FileHandle, charString);
exception
when no_data_found then
utl_file.fclose(v_FileHandle);
exit;
END;
dbms_output.put_line(charString);
if finalStr is not null then
finalStr := finalStr || charString;
else
finalStr := charString;
end if;
end loop;
-- for inserting the XML data into the table
insCtx := DBMS_XMLSTORE.NEWCONTEXT('RIDB.TRIALZIPCODES');
insCtx := DBMS_XMLSTORE.INSERTXML(insCtx, finalStr);
dbms_output.put_line('INSERT DONE '||TO_CHAR(rowsp));
DBMS_XMLStore.closeContext(insCtx);
END;
END TRIAL;
For the first time when i complied i got the errors as :
Procedure RIDB.PROCEDURE1@RIDB
Error(16,14): PLS-00201: identifier 'UTL_FILE' must be declared
Error(16,14): PL/SQL: Item ignored
Error(29,1): PLS-00320: the declaration of the type of this expression is incomplete or malformed
Error(29,1): PL/SQL: Statement ignored
Error(33,1): PL/SQL: Statement ignored
Error(33,19): PLS-00320: the declaration of the type of this expression is incomplete or malformed
Error(36,1): PL/SQL: Statement ignored
Error(36,17): PLS-00320: the declaration of the type of this expression is incomplete or malformed
So i logged in as sys & grant the permission to execute on UTL_FILE to ridb (user):
SQL Statement:
grant execute on utl_file to ridb
So, it got compiled successfully but when i execute it gives me error as:
Source does not have a runnable target.
What does this mean?
So I browse through forum & i got to know that i need to initial the UTL_FILE_DIR ="C:/OracleProject" in init.ora
So can i edit the init.ora with notepad.When i tried to do that it says permission denied
In my system it shows the init.ora file in path C:\oraclexe\app\oracle\product\10.2.0\server\config\scripts
but there is also other file initXETemp in the same path do i need to do the changes in it.
I have tried even editing the SPFILE as mentioned below:
C:\oraclexe\app\oracle\product\10.2.0\server\dbs\SPFILEEXE - I had edit this file using notepad & set the value of UTL_FILE_DIR ="C:/OracleProject". So next time when i restarted i'm unable to log on to the database.
So i had reinstall the software again.
Could you please let me know how to proceed..hi,
I have created the directory from sys database
CREATE or replace DIRECTORY XML_DIR2 AS 'C:\OracleProject';
& grant read,write access to the user
grant read,write on directory XML_DIR2 to RIDB;
& i had change the tag name in the xml file as shown below:
<?xml version = '1.0'?>
<metadata>
<Zipcodes>
<mappings Record="4">
<STABBRE>CA</STABBRE>
<ZIPCODE>94301</ZIPCODE>
</mappings>
<mappings Record="5">
<STABBRE>CO</STABBRE>
<ZIPCODE>80323</ZIPCODE>
<ZIPCODEEXT>9277</ZIPCODEEXT>
</mappings>
</Zipcodes>
</metadata>
TRIALZIPCODE table as shown below:
CREATE TABLE "RIDB"."TRIALZIPCODE"
( "STABBRE" VARCHAR2(20 BYTE),
"ZIPCODE" NUMBER(*,6) NOT NULL ENABLE,
"ZIPCODEEXT" NUMBER
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS" ;
I have tried two methods as shown below:
Procedure 1:
create or replace
PROCEDURE TRIAL_V2 AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
cnt NUMBER;
xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
--XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
BEGIN
insCtx := DBMS_XMLStore.newContext('DEV.TRIALZIPCODES');
DBMS_XMLStore.setUpdateColumn(insCtx, 'STABBRE');
DBMS_XMLStore.setUpdateColumn(insCtx, 'ZIPCODE');
DBMS_XMLStore.setUpdatecolumn(insCtx, 'ZIPCODEEXT');
DBMS_XMLStore.setRowTag(insCtx, 'mappings');
cnt := DBMS_XMLStore.insertXML(insCtx, xmldoc);
DBMS_XMLStore.closeContext(insCtx);
END;
Procedure 1 was compiled with out errors but when i execute i got the error as :
Source does not have a runnable target.
Procedure 2_
CREATE OR REPLACE PROCEDURE TRIAL_V3 AS
BEGIN
DECLARE
-- declare attributes
charString varchar2(80);
finalStr varchar2(4000) := null;
rowsp integer;
v_FileHandle UTL_FILE.FILE_TYPE;
l_context_handle dbms_xmlgen.ctxHandle;
insCtx DBMS_XMLStore.ctxType;
cnt NUMBER;
xmldoc xmltype := xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') );
--XML_DIR VARCHAR2(40) := 'C:\\OracleProject';
BEGIN
INSERT INTO trialzipcode (STABBRE, ZIPCODE, ZIPCODEEXT)
SELECT extractvalue(x.column_value, 'mappings/STABBRE'),
extractvalue(x.column_value, 'mappings/ZIPCODE'),
extractvalue(x.column_value, 'mappings/ZIPCODEEXT')
FROM TABLE(
XMLSequence(
EXTRACT(
xmltype( bfilename('XML_DIR2','trialxml.xml'), nls_charset_id('AL32UTF8') ),
'metadata/Zipcodes/mappings'
) x
END;
END TRIAL_V3;
Procedure 2 was complied without errors but when i execute i got the error as:
Connecting to the database RIDB.
ORA-22288: file or LOB operation FILEOPEN failed
The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_LOB", line 523
ORA-06512: at "SYS.XMLTYPE", line 287
ORA-06512: at "RIDB.TRIAL_V3", line 12
ORA-06512: at line 2
Process exited.
Disconnecting from the database RIDB.
Could you please let me know how to proceed...
Maybe you are looking for
-
Hi, I have Unit tests in VS2008 and the test configuration is set to generate Source Code Coverage, where I have selected all the referred assemblies. But when my tests finish executing, I just the code coverage for my unittest.dll and not the assemb
-
Can we call custom functions in view objects?
Can we call custom functions in view objects?these custom functions are from my backing bean... Please help.....
-
After Effects exports picture as a black frame?
I just graded a simple picture in AE and after I exported the picture I went to look at the image file and all It was was a black frame. I'ved tried different formats, and I've tried exporting it as a .psd for photoshop but it still won't work. Can s
-
Quicktime & iTunes 7.3.2 won't install due to insufficient privlidges?
It says I'm my computers administrator when I am. Does anyone have any tips for solving this?
-
[SOLVED] UEFI system booting from MBR partition table and GRUB legacy
I'm trying to understand once and for all the process by which Arch can be booted from a system with UEFI firmware and an MBR partition table. Some of the information on the wiki seems conflictual / non-nonsensical at times. Apologies in advance if t