Results 1 to 2 of 2
Thread: Some problem in fetching record
- 03-20-2009, 01:25 PM #1
Member
- Join Date
- Mar 2009
- Posts
- 13
- Rep Power
- 0
Some problem in fetching record
hi
this is my code
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:project ","scott","tiger");
String s="select siteid from sitedetail1;";
PreparedStatement stmt=con.prepareStatement(s);
ResultSet rs=stmt.executeQuery();
while(rs.next())
{
int i;
for(i=0;rs.next();i++)
{
sid.add(""+rs.getInt(1));
}
}
con.close();
stmt.close();
}
catch(Exception e1)
{
e1.printStackTrace();
}
in this code i have bind database field with combobox
this code is compile and run but proper results r not given
all records in perticular field is not fetch in combo box special 1st record is not fetched fetching is starting from second record.
any logical mistake then please advise me what is correct code
- 03-27-2009, 11:19 AM #2
Member
- Join Date
- Mar 2009
- Posts
- 1
- Rep Power
- 0
Similar Threads
-
Fetching sequence
By Shivraj in forum New To JavaReplies: 1Last Post: 03-19-2009, 02:30 PM -
problem with fetching data
By payal.mitra86 in forum JDBCReplies: 0Last Post: 05-24-2008, 01:29 PM -
Fetching rows from DB
By Java Tip in forum Java TipReplies: 0Last Post: 02-06-2008, 09:23 AM -
Problem calling classes to flip coin x number of times and record heads or tails
By adlb1300 in forum New To JavaReplies: 2Last Post: 11-11-2007, 08:07 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks