Results 1 to 3 of 3
  1. #1
    pardhu is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default Retrieval problem

    Dear frnds,
    I have created a table and inserted rows into it using insert query.
    When I am trying to retrieve them using them I'm not getting them.


    import java.sql.*;
    class imp
    public static void main(String args[])throws Exception
    Connection con=DriverManager.getConnection("jdbc:odbc:pardhu" ,"scott","tiger");
    System.out.println("connection established");
    Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select * from mca");

    If I am using a java program to insert rows into the table, I am able to retrieve them.
    But If I am inserting the rows using insert query, I am not able to retrieve the rows.

    Can anyone help me plz......

  2. #2
    Mithilesh is offline Member
    Join Date
    Nov 2012
    Rep Power

    Thumbs up Re: Retrieval problem

    Create DSN as you mentioned in your program and then you must do commit after inserting some rows in database .After that you try to run this program hopefully it will work.
    Last edited by Mithilesh; 11-11-2012 at 03:20 PM.

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Rep Power

    Default Re: Retrieval problem

    Please use [code] tags [/code] when posting code.

    What database are you using?
    Is the above code throwing an exception? If so, what is the full exception including stack trace.
    If not then are you seeing any data at all?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Image retrieval
    By KiranA in forum New To Java
    Replies: 1
    Last Post: 07-11-2011, 08:29 PM
  2. URL retrieval using swings
    By gbose in forum AWT / Swing
    Replies: 1
    Last Post: 02-07-2010, 03:19 PM
  3. web image retrieval
    By ak88 in forum New To Java
    Replies: 3
    Last Post: 01-05-2010, 12:37 PM
  4. retrieval of tags
    By mahalakshmi in forum New To Java
    Replies: 1
    Last Post: 02-23-2009, 01:58 PM
  5. Lucene Image REtrieval 0.5.4
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-11-2007, 04:54 PM

Posting Permissions

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