This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i pass recordset value to string variable

 
muhammad fahim
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi master

sir how i pass table column value into string variable

see my code but not run

====
import java.sql.*;
public class Waheed {
public Waheed() {
}
public static void main (String args [])
{
String s = "9 23 45.4 56.7";

System.out.println ("going for connection");
// DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());

try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc racle:thin:@fahim:1521:aamir","muhammad","mfa786");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select accid from accbal");
System.out.println ("going for connection");
while (rset.next())

s= rset.getString("accid"); this line give me error

System.out.println (rset.getString("accid"));
System.out.println (s);
}
catch(Exception e){
e.printStackTrace();
}
}
}


sir only this line give me error

s= rset.getString("accid"); this line give me error

s is string variable

plese give me idea how i pass accid in s variable

thank

aamir
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please provide the exact error message.
 
muhammad fahim
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank's for yur reply

sir i solve that problem

my next problem regarding grid

how i use grid in applet becuase i have mulitpul record how i show that all record in applet grid

please give me idea how i how my all record in applet grid

thanks

aamir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic