
I have created a table named empdetails in postgreSql 8.4 databse. There is a field named empsex whose data type is char.
I have created resultset for this table and tried to access the access empsex as follows:
public EmployeeAddEdit(int emp_id) {
String strSql = "SELECT empid, empfname,emplname,empdateofbirth,empsex,empaddress as address,empphno,emppic,empbiodata FROM empdetails where empid=" + empid;
Connection con = null;
Statement smt = null;
ResultSet rset = null;
utility.db.Connect c;
try {
c = new utility.db.DBSource().connectToTEST();
con = c.getConnection();
smt = con.createStatement();
rset = smt.executeQuery(strSql);
if (rset.next()) {
this.setIsRecordPresent(true);
this.connectToTEST(rset.getInt("empid"));
this.setEmpfname(rset.getString("empfname"));
this.setEmplname(rset.getString("emplname"));
this.setEmpdateofbirth(rset.getDate("empdateofbirth"));
this.setEmpsex(rset.getString("empsex"));
}.....................................................
But i found this.setEmpsex(rset.getString("empsex")); as erroneous. There is no method like getChar() also. Please tell me how i can access it.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.