Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How to save output of java program in oracle database.

  1. #1
    Junior Member
    Join Date
    Dec 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to save output of java program in oracle database.

    I have written java program which can extract online data from url and i want to store it in data base in new token row in table so than i can use in my application . how could it be done using type4 drive .. if any one had any solution kindly help me .....
    these are my code ...
    import javax.swing.text.html.parser.*;
    import javax.swing.text.html.*;
    import javax.swing.text.*;
    import java.io.*;
    import java.util.StringTokenizer;
    import java.net.*;

    public class ParseTest extends HTMLEditorKit.ParserCallback {
    HTML.Tag t=null;
    String name1=null;
    boolean flag1;
    public void handleText(char[] data, int pos){
    if(t==HTML.Tag.DIV && name1.equals("responseDiv")){
    String csvString=new String(data);
    StringTokenizer tokenizer = new StringTokenizer(csvString, ",");

    while(tokenizer.hasMoreTokens())
    {
    System.out.println(tokenizer.nextToken());
    }
    System.exit(0);
    }
    }
    public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos){
    this.t=t;
    if(t==HTML.Tag.DIV)
    name1=(String)a.getAttribute(HTML.Attribute.ID);
    }
    public void handleEndTag(HTML.Tag t, int pos){
    }
    public void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos){
    }
    public static void main(String argv[]){
    try {
    URL url = new URL("http://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuote.jsp?symbol=acc");
    InputStream in =url.openStream();
    InputStreamReader r=new InputStreamReader(in);
    ParserDelegator parser = new ParserDelegator();
    HTMLEditorKit.ParserCallback callback = new ParseTest();
    parser.parse(r, callback, true);
    } catch (IOException e){
    e.printStackTrace();
    }
    }
    }


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 697 Times in 679 Posts

    Default Re: How to save output of java program in oracle database.

    Please post your code correctly using code or highlight tags which are explained near the top of this link.

    Most will not help with improperly posted code. It's too hard to read, and I'm not sure anyone knows what you're talking about when you mention a 'type4 drive' or why that matters.

Similar Threads

  1. How to capture or save the output given by java program.
    By Sahil Arora in forum What's Wrong With My Code?
    Replies: 11
    Last Post: November 14th, 2013, 11:54 AM
  2. Replies: 1
    Last Post: March 15th, 2013, 10:28 AM
  3. Java Barcode Program with Oracle database
    By techsing14 in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: December 6th, 2012, 05:19 AM
  4. Replies: 1
    Last Post: April 19th, 2012, 08:24 AM
  5. Inserting Large XML file into Oracle Database through java
    By hari_582 in forum JDBC & Databases
    Replies: 4
    Last Post: April 15th, 2012, 06:49 AM