Results 1 to 3 of 3
Thread: Retrieval problem
- 11-11-2012, 12:04 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 16
- Rep Power
- 0
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.
MY PROGRAM
import java.sql.*;
class imp
{
public static void main(String args[])throws Exception
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
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");
while(rs.next())
{
System.out.println(rs.getString(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
System.out.println(rs.getString(4));
}
}
}
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......
- 11-11-2012, 02:16 PM #2
Member
- Join Date
- Nov 2012
- Posts
- 1
- Rep Power
- 0
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 02:20 PM.
- 11-12-2012, 10:54 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,480
- Rep Power
- 16
Similar Threads
-
Image retrieval
By KiranA in forum New To JavaReplies: 1Last Post: 07-11-2011, 07:29 PM -
URL retrieval using swings
By gbose in forum AWT / SwingReplies: 1Last Post: 02-07-2010, 02:19 PM -
web image retrieval
By ak88 in forum New To JavaReplies: 3Last Post: 01-05-2010, 11:37 AM -
retrieval of tags
By mahalakshmi in forum New To JavaReplies: 1Last Post: 02-23-2009, 12:58 PM -
Lucene Image REtrieval 0.5.4
By JavaBean in forum Java SoftwareReplies: 0Last Post: 07-11-2007, 03:54 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks