how send table data to applet from java class [message #213059] |
Tue, 09 January 2007 04:48 |
mfa786
Messages: 210 Registered: February 2006 Location: karachi
|
Senior Member |
|
|
hi master
sir i send code from applet and run query as per given code how i send geting data to applet return
system return same code no change
if i send K1
end system return K1 not give title or result
i use this code from applet
jTextField5.setText(testcall.mfa3((String)jTextField2.getText()));
this code in java class
public String mfa3(String s){
String mfatt ="K1";
String query = "select title from chartofacc where accid="+ "'" + mfatt.replaceAll("\\'", "\\'\\'") + "'";
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@fahim:1521:aamir","muhammad","mfa786");
Statement stmt = conn.createStatement();
/*ResultSet rset = stmt.executeQuery("select title,accid from chartofacc where accid='K1'");*/
ResultSet rset = stmt.executeQuery(query);
while (rset.next())
s = rset.getString("title");
}
catch(Exception e){
e.printStackTrace();
}
return s;
}
please give me idea how i send result to applet
thank
aamir
|
|
|