NEW TO XML AND JAVA

hi, I'm new to xml, actually I'm taking a course in xml and I should choose a certain project related to xml.
I want to ask about xml and java
the things that I know about java is some classes ( I made a program of bouncing ball in java and changed some java game programs). but I need to know how to use java in databases and how to relate it to xml
Is it too dificult or I can learn it knowing that I'm ready to learn and already I'm learning xml.
If anyone wants to help me please send me links to some websites where it is simple to learn java .
Also if any one can give me an example of a certain project that can be done easily using java and xml u'll be more than welcome

Check the JAVA XML Tutorials provided by the Java Site.

Similar Messages

  • New to XML - what can XML and java do thogether - brief examples please

    I am new to XML and relatively new to Java, thought not new to programming. I am still trying to figure out what can XML do for me in practical terms and when I should use it. Thanks for any examples of when to use XML in conjunction with Java.

    xml : Think of it in terms of business solutions, the way you would think of HTML for drawing fun web-pages.
    java : If you know anything about databases you would know you can embed java with sql E.T.C.
    Therefore because of the fast response times and the amount of constant interaction for business purposes you will need a database type that is strong to handle XML, therefore with such new technology you will be able to use xml databases with java too.
    l am sorry : XML Technology is not more simple than that to explain.
    If you are a christian or jew it is like saying to someone explain the bible,the prophets,the old and new testament in one sentence!!!You get it.What one can do is slightly break-up the bible and say there's an old and new testament.The old testament refers to the time before Jesus, AND the new testament refers to After Jesus, THE PROPHETS RELATE MORE TO THE TIME BEFORE Jesus.
    You can then ask me who is jesus???
    And thats a tricky question in its self becuse it depends on one's thinking(concept)
    I HOPE IT HELPS YOU !!!!
    GOD DAY MATE!!

  • New to XML and Oracle

    Just trying to clarify some issues as I try and learn about XML, and specifically how it integrates into the DB.
    1 - Is there a way with Oracle tools for me to get an XSD of an existing 9i relational schema? We are not currently using the XML DB, but our middleware developers would like to have an up to date XSD to use for their internal mapping.
    2 - Is there any way that I can keep that XSD up-to-date automatically, so I get a new one whenever the schema gets updated?
    3 - If I wanted to investigate storing XML docs within the DB in native XML format, I need to have an XML DB, correct? Is this DB construct maintained seperatelly from my "normal" relational schema? or are they kept in sync by Oracle?
    I know these may all be real basic questions, but as I said, I'm new to XML and Oracle. I am reading as much as I can, but there are a lot of docs out there.
    Thanks,
    Mike

    Hi
    1. On my opinion such a tool doesn't exists. Some parts can be implemented elsewhere, but not as described by you... e.g. with XSU if you specify the parameter "withschema" the XSD of the executed statement is generated. Another example is to use DBMS_METADATA to dump the data dictionary in XML (but not XSD, of course you could write your own XSLT to do this transformation...).
    2. -
    3. If you use XSD-based tables the XSD and the relational model are stored separately in the data dictionary. Therefore if you change the XSD you have to drop/create the XSD-based table... no schema evolution yet.
    Chris

  • XML and Java

    I am new in using xml in java, can any one tell me how to call XML file in java and how to read from it .
    Regards
    rajin

    Look at the XML chapters of the J2EE 1.4 Tutorial:
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
    -Ian Evans

  • I'd like to load images using XML and Java - hints??

    I have a XML files that are created on a timed basis....they describe a photo and point to a dir where the photo is stored...like...
    <image>
    <user>bill</user>
    <img>photo.jpg</img>
    <img_dir>'/tmp/photos'</img_dir>
    </image>
    I'd like to write a Java program that parses the XML and loads the images, data into Oracle.
    Suggestions on Oracle tools, downloads that will help me accomplish this???
    Thanks!

    I pass a URL and then when I parse the XML I download the file from the URL.
    A.

  • XMl and Java object mapping

    I need to map java objects with XMl Node or XML Elements.
    My java objets get some attributes, for instance name,color ...
    and i need an output like:
    <OBJECT_OF_TYPE_XXX>
    <NAME>scott</NAME>
    <COLOR>red</COLOR>
    </OBJECT_OF_TYPE_XXX>
    Any idea?
    Thanks
    Maurice

    You can try JAXB which includes a compiler that generates classes based on the XML Schema for your xml structure. It also features the possibility to convert between xml and the generated objects.
    Take a look at chapter 9 and 10 at http://java.sun.com/webservices/docs/1.1/tutorial/doc/index.html

  • New in Oracle and Java

    I used Sql Server and .Net for developing application to now. I switch to Oracle and Java recently. I have installed Oracle 11g. What I need to start developing aoolication with Java and Oracle?
    Has Oracle a graphical interface like MS Sql Server? how can I install them? What Developing Environment You suggest for Java? I am familiar with eclipse.

    user987274 wrote:
    I used Sql Server and .Net for developing application to now. Which means 1 year or 5?
    I switch to Oracle and Java recently. I have installed Oracle 11g. What I need to start developing aoolication with Java and Oracle? Starting basics.
    1. Learn basics of java
    2. Learn basics of Oracle
    3. Learn JDBC which allows you to code in java and talk to Oracle.
    Do not attempt step 3 until you have complete 1 and 2.
    Has Oracle a graphical interface like MS Sql Server? That would be a Oracle question rather than a java question. There are other forums on this site specific to Oracle.
    Myself I just use sqlplus.
    how can I install them? Huh? Just like you install anything else.
    1. Acquire appropriate software
    2. Read documentation
    3. Install
    4. Look for post install options that might be relevant.
    What Developing Environment You suggest for Java? I am familiar with eclipse.I presume that you mean that you know eclipse exists for java rather than that you have used it before.
    Since you are probably used to using Visual Studio, then you probably want an IDE. Eclipse will suffice for that.

  • XML and Java Store Procedures

    I have written JDBC Classes that are using OracleXMLObject and they are successfully working outside of Oracle.
    I can successfully load them and create procedures for them. But, when I call them, I'm told that method does not exist.
    Please help, can you provide a working example?
    Regards,
    Bruce

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mark Abram ([email protected]):
    Can you post some snippets of your code
    so we can have a better idea what you trying to do?<HR></BLOCKQUOTE>
    Dear Mark,
    Here is the code:
    import java.sql.*;
    import java.math.*;
    import oracle.xml.sql.query.*;
    import oracle.jdbc.*;
    import oracle.jdbc.driver.*;
    //Title:
    //Version:
    //Copyright: Copyright (c) 1999
    //Author: Bruce Kearney
    //Company: Atrion International
    //Description:
    public class IncidentTypeDB {
    // public static void main(String args[]) throws SQLException
    public void getEverything()
    try
    Connection connection = new OracleDriver().defaultConnection();
    OracleXMLQuery query = new OracleXMLQuery(connection, "select " +
    "incidenttypeidseq, incidenttype from incident_type");
    query.setMaxRows(query.MAXROWS_ALL);
    query.setRowsetTag("ROOTDOC");
    query.setRowTag("DBROW");
    String xmlString = query.getXMLString();
    System.out.println(xmlString);
    connection.close();
    } catch (SQLException e)
    System.out.println("Error retrieving record.");
    System.out.println(e.toString());
    return;
    } catch (Exception e)
    System.out.println("Error connecting to database.");
    System.out.println(e.toString());
    return;
    Regards,
    Bruce
    null

  • Problem with new-line-character and java.io.LineNumberReader under AIX

    Hi folks,
    I got the following problem: I wrote a little parser that reads in a plain-text, tabulator-separated, line-formatted logfile (and later on safes the data to a 2-dimensional Vector). This logfile was originally generated by an AIX ksh script, however, I copied it on my Windows machine to work with it (for I'm using a Java editor that runs under Win Systems).
    For any reason, Windows, and what is worse Java too, seems not to recognize correctly the new-line character (in the API it is written that this should be a newline '\n' or a carriage-return '\r' or one followed by the other) that marks the end of a line in the logfile.
    Also, when I'm opening the logfile with the "Notepad"-editor, this special character does not seem to be recognized, every line is inserted right after the other.
    On the other side, when I open the logfile with the built-in editor in the CMD-Shell ("Dos-shell"), the newline chars seem to be recognized correctly.
    But when start my parser on the AIX-machine the newline does not seem to be recognized correctly again.
    I tried to read in the logfile with MS-Excel and safe it as a plain-text, tabulator-separated, line-formatted logfile again, with such files my parser works fine both on the AIX as it does on Windows.
    Any ideas? Anybody got over the same problem already?
    Greetz FK

    Under windows, text files' lines are usually delimited by \r\n,
    under Unix/Linux/AIX etc. \n
    and under Mac \r.
    I recommend to use the following editors, which are capable to handle files with Unix and Windows-styled line-delimiters or convert between these types:
    Programmer's File Editor (PFE; available on Windows)
    The Nirvana Editor (http://www.nedit.org/; available on Unix, MAcOS, Windows)
    (BTW good old vim can handle that too. Transferring text files to windows in order to edit them, even using Excel for this purpose means your being a UNIX newbie, (I mean no offense by writing this) so vim is probably beyond your reach for the moment.)
    Java normally assumes the platform's line delimiters where it is running, so if you transferred the file from Unix to Windows might be distrurbing.

  • XML to Java and back again

    Okay, I've seen this question asked many times and I don't see a lot of great solutions. I've been searching for the last hour and looked at xBeans, XMLBeans, xStream, you name it. Anyway, what I want to do is model my XML and Java objects (if I can't auto-generate the classes) and then at runtime the XML should be loaded directly into the data model. I know that writing a custom parser is old school and there are tools to do this for me but I can't seem to find what I need. What do you recommend for doing this?

    Check out the Commons Digester.
    The Digester package lets you configure an XML -> Java object mapping module, which triggers certain actions called rules whenever a particular pattern of nested XML elements is recognized.
    You can't get any better than this....in my opinion.
    Good Luck!

  • XML and its influence over program design (2 issues)

    I have 2 open questions about XML and Java. I apologise if they are not clear-cut or specific enough, but really I am fishing for sound advice.
    I am trying to develop a J2EE application but find myself stuttering at an early stage because I cannot decide on the best design for my application. Part of my problem is a lack of experience with the different J2EE technologies/API (especially XML APIs), and the realisation that there is 101 ways to do what I want to do.
    A major issue is this: my application basically is concerned with representing conversations between the server and a user, e.g. a simple sequence of yes/no questions asked by the server to the user, which the user replies to in turn. I believe that the XML format would be a very suitable way to represent these conversations. My first question is:
    * Should the decision to use XML as a storage format influence the design of the rest of the program? I feel that in choosing XML to represent the conversation data, I am stuck thinking about the rest of my program in a XML way (i.e. doing everything using a DOM etc.). Am I right in thinking that my program should be designed in such a way that an XML-based storage system could be easily interchanged with, say, a relational flat-tabled database?
    My second question is:
    * Imagine that each conversation contains one or more questions, and there are, say, 4 different types of question (e.g. yes/no, multiple choice, etc.). Each of these needs to be handled in a different way. Is there a good pattern or recommended way of handling this sort of situation in code, ideally avoiding a big 'if' or switch statement (e.g. if the node is of "ABC" type do this, else if it is "yes/no"...). It would be great if one could easily add new types of question to the XML and then similarly one can make easy additions to the code to cope with these new cases.
    Thank you very much indeed for any advice.
    Greg

    I am trying to develop a J2EE application but find
    myself stuttering at an early stage because I cannot
    decide on the best design for my application. Part of
    my problem is a lack of experience with the different
    J2EE technologies/API (especially XML APIs), and theThat's nothing to be ashamed of. And realising that you lack experience and trying to remedy that is a good sign.
    A major issue is this: my application basically is
    concerned with representing conversations between the
    server and a user, e.g. a simple sequence of yes/no
    questions asked by the server to the user, which the
    user replies to in turn. I believe that the XML
    format would be a very suitable way to represent
    these conversations. My first question is:
    XML might be overkill if it's just a question followed by an answer and neither contains complex hierarchical data structures.
    * Should the decision to use XML as a storage format
    influence the design of the rest of the program? ICertainly not.
    XML should represent data structures that are natural to your program, thus becoming a tool rather than forcing its structure upon you.
    feel that in choosing XML to represent the
    conversation data, I am stuck thinking about the rest
    of my program in a XML way (i.e. doing everything
    using a DOM etc.). Am I right in thinking that my
    program should be designed in such a way that an
    XML-based storage system could be easily interchanged
    with, say, a relational flat-tabled database?
    Flexibility is good to keep in mind, but at the moment I'd worry about just getting something to work.
    * Imagine that each conversation contains one or more
    questions, and there are, say, 4 different types of
    question (e.g. yes/no, multiple choice, etc.). Each
    of these needs to be handled in a different way. Is
    there a good pattern or recommended way of handling
    this sort of situation in code, ideally avoiding a
    big 'if' or switch statement (e.g. if the node is of
    "ABC" type do this, else if it is "yes/no"...). It
    would be great if one could easily add new types of
    question to the XML and then similarly one can make
    easy additions to the code to cope with these new
    cases.
    Think of a factory that creates the handlers on the fly based on the actual message received.
    If the factory makes use of some mapping construct to do so there's no need for any conditionals at all in your decision tree.
    I've myself used XML structures successfully to define such mappings (and so have others) on disc, but simple ones can be easily represented using just a properties file.

  • XML with Java

    Hi,
    I am new in XML and I need to design a Java GUI interface for managing changes to xml data(inserting, deleting of nodes). But i have no idea on how the communication is going to be established (How to link java to xml..).
    Any help will be very very appreciated!
    Thank You
    cheers,
    jun

    if you use the latest JDK (1.4), you will have all what you need to manipulate XML in Java.
    then follow this tutorial: http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM.html
    it'll get you started!

  • Printinting XML in JAVA

    I have the following XML file and the java file to read the xml contents.
    I compiled the java file.When i read it it says,
    parsing error line 0, uri null
    d:\book.xml not found.
    the xml and java file are in same path only. whats the problem?
    following is the code:
    java file
    import java.io.File;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class ReadAndPrintXMLFile{
    public static void main (String argv []){
    try {
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    File fobj=new File("D:\\book.xml");
    System.out.println("file :"+fobj);
    Document doc = docBuilder.parse(fobj);
    // normalize text representation
    doc.getDocumentElement ().normalize ();
    System.out.println ("Root element of the doc is " + doc.getDocumentElement().getNodeName());
    NodeList listOfPersons = doc.getElementsByTagName("person");
    int totalPersons = listOfPersons.getLength();
    System.out.println("Total no of people : " + totalPersons);
    for(int s=0; s<listOfPersons.getLength() ; s++){
    Node firstPersonNode = listOfPersons.item(s);
    if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
    Element firstPersonElement = (Element)firstPersonNode;
    NodeList firstNameList = firstPersonElement.getElementsByTagName("first");
    Element firstNameElement = (Element)firstNameList.item(0);
    NodeList textFNList = firstNameElement.getChildNodes();
    System.out.println("First Name : " + ((Node)textFNList.item(0)).getNodeValue().trim());
    NodeList lastNameList = firstPersonElement.getElementsByTagName("last");
    Element lastNameElement = (Element)lastNameList.item(0);
    NodeList textLNList = lastNameElement.getChildNodes();
    System.out.println("Last Name : " + ((Node)textLNList.item(0)).getNodeValue().trim());
    NodeList ageList = firstPersonElement.getElementsByTagName("age");
    Element ageElement = (Element)ageList.item(0);
    NodeList textAgeList = ageElement.getChildNodes();
    System.out.println("Age : " + ((Node)textAgeList.item(0)).getNodeValue().trim());
    }//end of if clause
    }//end of for loop with s var
    }catch (SAXParseException err) {
    System.out.println ("** Parsing error" + ", line " + err.getLineNumber () + ", uri " + err.getSystemId ());
    System.out.println(" " + err.getMessage ());
    }catch (SAXException e) {
    Exception x = e.getException ();
    ((x == null) ? e : x).printStackTrace ();
    }catch (Throwable t) {
    t.printStackTrace ();
    }//end of main
    FOllowing is the XML file:
    <?xml version="1.0"?>
    <book>
    <person>
    <first>Kiran</first>
    <last>Pai</last>
    <age>22</age>
    </person>
    <person>
    <first>Bill</first>
    <last>Gates</last>
    <age>46</age>
    </person>
    <person>
    <first>Steve</first>
    <last>Jobs</last>
    <age>40</age>
    </person>
    </book>

    I have the following XML file and the java file to
    read the xml contents.
    I compiled the java file.When i read it it says,
    parsing error line 0, uri null
    d:\book.xml not found.
    the xml and java file are in same path only. whats the
    problem?
    following is the code:
    java fileMalisun,
    Is your java pgm. and XML file in the root directory of D: drive? By writing code as File fobj = new File("D:\\book.xml"); you indicate that the file is in the root directory of your D: drive. I just changed the following line:
    File fobj=new File("D:\\book.xml");to
    File fobj=new File("book.xml");and the program worked fine. I hope this helps.

  • How use XSD and Java? What classes/methods?

    I want to use an XSD instead of a DTD with my XML and Java. Does anyone know the classes/methods I should use to do this? Is it even possible? Can you send sample code?

    here is the helper function... hope it helps...
    import java.io.IOException;
    import java.math.*;
    import java.text.*;
    import org.xml.sax.Attributes;
    import org.xml.sax.ContentHandler;
    import org.xml.sax.ErrorHandler;
    import org.xml.sax.Locator;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import org.xml.sax.XMLReader;
    import org.xml.sax.helpers.XMLReaderFactory;
    public class SAXParserDemo
         public SAXParserDemo()
         public void performDemo(String uri)
              System.out.println("Parsing XML file: " + uri + "\n\n");
              ContentHandler contentHandler = new MyContentHandler();
              ErrorHandler errorHandler = new MyErrorHandler();
              try
                   XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
                   parser.setContentHandler(contentHandler);
                   parser.setErrorHandler(errorHandler);
                   parser.setFeature("http://xml.org/sax/features/validation", true);
                   parser.parse(uri);
              catch(IOException e)
                   System.out.println("Error reading URI: " + e);
              catch(SAXException e)
                   System.out.println("Error in parsing: " + e);
         public static void main(String[] args)
              if(args.length != 1)
                   System.out.println("Usage: java SAXParserDemo [XML URI]");
                   System.exit(0);
              String uri = args[0];
              SAXParserDemo parserDemo = new SAXParserDemo();
              parserDemo.performDemo(uri);
    class MyErrorHandler implements ErrorHandler
         public void warning(SAXParseException exception) throws SAXException
              throw new SAXException("Warning encountered."+exception);
         public void error(SAXParseException exception) throws SAXException
              throw new SAXException("Error encountered: "+exception);
         public void fatalError(SAXParseException exception) throws SAXException
              throw new SAXException("Fatal error encountered."+exception);
    class MyContentHandler implements ContentHandler
         private Locator locator;
         public void setDocumentLocator(Locator locator)
              //System.out.println("     * setDocumentLocator() called");
              this.locator = locator;
         public void startDocument() throws SAXException
              //System.out.println("System Message: Parsing begins...");
         public void endDocument() throws SAXException
              //System.out.println("System Message: ...Parsing ends.");
         public void processingInstruction(String target, String data) throws SAXException
              //System.out.println("System Message: PI: Target: "+target+" and Data: "+data);
         public void startPrefixMapping(String prefix, String uri)
              //System.out.println("System Message: Mapping starts on prefix "+prefix+" mapped to URI "+uri);
         public void endPrefixMapping(String prefix)
              //System.out.println("System Message: Mapping ends on prefix "+prefix);
         public void startElement(String namespaceURI, String localName, String rawName, Attributes atts) throws SAXException
              //System.out.println("System Message: startElement: "+localName);
              if(!namespaceURI.equals(""))
                   //System.out.println("System Message: in namespace "+namespaceURI+" ("+rawName+")");
              else
                   //System.out.println("System Message: has no associated namespace");
              int i;
              for(i=0;i<atts.getLength();i++)
                   //System.out.println("System Message: Attribute: "+atts.getLocalName(i)+"="+atts.getValue(i));
         public void endElement(String namespaceURI, String localName, String rawName) throws SAXException
              //System.out.println("System Message: endElement: "+localName+"\n");
         public void characters(char[] ch, int start, int length) throws SAXException
              String s = new String(ch, start, length);
              //System.out.println("System Message: characters: "+s);
         public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
              String s = new String(ch, start, length);
              //System.out.println("System Message: ignorableWhitespace: ["+s+"]");
         public void skippedEntity(String name) throws SAXException
              //System.out.println("System Message: Skipping entity: "+name);
    }

  • Using XML or Java Scripting

    Hello all
    i am new to obi ee and i wanna know how can we use the codes of xml and java scripting in it and i am sitting on the client system...Do i need to change some files on server???
    thanks in advance,
    pankaj

    You mean like in this thread? Re: Creating a Popup Box / List of Values on a Dashboard
    What's the idea behind it?
    Why this and not a prompt?
    Input mask for write-back?
    Cheers,
    C.

Maybe you are looking for

  • Windows 7 Ultimate 64-bit memory use issue on 890FXA-GD70 board

    ...Having read the stickies on memory recognition and speed potential, my issue is slightly different.   As noted on my system below, I have 4 x 2GB memory sticks of G.Skill F3-12800CL7D-4GBRM DDR3-1600 with CL7-8-7-24 1.6V rating.  I previously had

  • Receiving Notifications via email

    I have a user who is not receiving an email notification when a requisition is forwarded to her for approval. Can anyone tell me what could be wrong?

  • Populate User Defined Fields

    Hello everyone,  I have an add on that puts a button on the invoice that when clicked, brings up a screen to fill in some information and submits the information.  The add-on then takes some of that info and populates UDFs on the invoice and submits

  • Setting the classpath of the JVM for OC4J

    Is there any way to add a path to the classpath when the embedded OC4J is run? Although the OC4J is finding my classes, the Oracle JDBC driver isn't. Here's a bit more info: I've been having a bit of a problem getting database java objects ("CREATE T

  • Queston of Business Object in Java

    Hi there, In business object context from Java, what is the meaning of "instance management algorithms"? Thanks Neo