Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Tolls

Thread: retiving daabase values by clicking a button

  1. #1
    naveen516 is offline Member
    Join Date
    Dec 2011
    Posts
    6
    Rep Power
    0

    Default retiving daabase values by clicking a button

    I am new to java, I have a requirement that
    I have a table like
    Id---Name---Password---email---phone
    101 naveen-11111--- nn@gmail--**** UPDATE
    ************************************* UPDATE
    ************************************ UPDATE
    like this.
    UPDATE is the button, If we click on UPDATE button, that particular row details must be come in another table like

    Id----*********
    Name--*********
    Password -*****
    Email--*******
    phone---********

    like this, I aam using jsp, and back end is Oracle and Type1 driver...


    Please help me.............

    Thanks and regards
    Naveen

  2. #2
    diamonddragon is offline Senior Member
    Join Date
    Jan 2012
    Posts
    210
    Rep Power
    3

    Default Re: retiving daabase values by clicking a button

    One way how You could do it:

    1. Create Connection(object) to database (using DriverManager or DataSource).
    2. Create Statement object that will insert necessary rows from table1 into table2(using apropriate SQL statement, say: INSERT INTO databaseX.table2 SELECT ... FROM databaseX.table1 WHERE ...)
    Last edited by diamonddragon; 02-09-2012 at 09:47 AM.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,407
    Rep Power
    20

    Default Re: retiving daabase values by clicking a button

    Use PreparedStatement instead of Statement.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    diamonddragon is offline Senior Member
    Join Date
    Jan 2012
    Posts
    210
    Rep Power
    3

    Default Re: retiving daabase values by clicking a button

    Quote Originally Posted by DarrylBurke View Post
    Use PreparedStatement instead of Statement.

    db
    Or may call addBatch method on simple statement object, call executeBatch method and commit connection object.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,087
    Rep Power
    20

    Default Re: retiving daabase values by clicking a button

    It's only one statement, so batching would be unecessary.
    Actually, the title of this thread doesn't seem to match the OP...the title implies a SELECT, and the post is talking about an UPDATE.
    DarrylBurke likes this.

  6. #6
    diamonddragon is offline Senior Member
    Join Date
    Jan 2012
    Posts
    210
    Rep Power
    3

    Default Re: retiving daabase values by clicking a button

    Then execute update statement singly.

Similar Threads

  1. Clicking button on HTML page
    By nephos in forum Advanced Java
    Replies: 1
    Last Post: 10-08-2011, 03:52 PM
  2. Replies: 6
    Last Post: 08-24-2011, 02:52 PM
  3. How to open new JFrame with clicking on button?
    By phearless in forum AWT / Swing
    Replies: 1
    Last Post: 01-14-2011, 10:36 AM
  4. Replies: 3
    Last Post: 08-07-2010, 08:06 PM
  5. Get source web page after clicking next Button
    By noob in forum New To Java
    Replies: 1
    Last Post: 03-05-2010, 09:01 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •