somebody please tell me why im not getting String(X) value as ID,Name,FName are being printed on console correctly but the name of ID(4) from my DB_table is not going into string(X);
package gym.resources.busyicons;
import java.sql.*;
class OdbcAccessQuery {
public static void main(String [] args) {
Connection con = null;
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:WWFDB");
Statement sta = con.createStatement();
// getting the data back
ResultSet res = sta.executeQuery(
"SELECT * FROM WWFTABLE WHERE ID=4");
while (res.next()) {
System.out.println(
" "+res.getInt("ID")
+ ", "+res.getString("NAME")
+ ", "+res.getString("FNAME"));
[B]String x = res.getString("NAME");
System.out.println("x="+x);[/B]
}
res.close();
sta.close();
con.close();
} catch (Exception e) {
System.err.println("Exception: "+e.getMessage());
}
}
}