Please tell me how I can access a field (data type char) of resultset in a java class

Please tell me how I can access a field (data type char) of resultset in a java class

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.

View Answers









Related Tutorials/Questions & Answers:
Please tell me how I can access a field (data type char) of resultset in a java class
Please tell me how I can access a field (data type char) of resultset in a java... databse. There is a field named empsex whose data type is char. I have created... how i can access
Please tell me how can i convert string to timer
Please tell me how can i convert string to timer  Please tell me how can i convert string to timer
Advertisements
Please tell me where I can find tutorials on spring hibernate?
Please tell me where I can find tutorials on spring hibernate?  Hello, Please tell me where I can find tutorials on spring hibernate? Thanks..   Dear Friend, You can find some good tutorials on Spring Hibernate here
please tell me what is ment by wrapper class in java........
please tell me what is ment by wrapper class in java........  what is ment by wrapper class in java
how can i get output pls urget tell me
how can i get output pls urget tell me  HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception
please tell me
please tell me  import java.io.*; class SString{ public static void...)); ^ 1 error please tell me the resolution of this   Hi...(); System.out.println("You have entered: "+(char)i); } } Thanks
please tell me
please tell me  i have created one table,when i close and again login, table name will be there, but its content not displayed, showing as no rows selected, please tell me the reason
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select length(ename)||' charecters exist in '||initcap(ename)||'s name' as "names and length" from emp
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select initcap(ename),job from emp where substr(job,4,length(job,4,3)))='age
please tell me
please tell me  class Person{ int age; String name; void Person1(String g,int a){ name=g; age=a; } Person(String s,int i){ name=s; age=i; } void..., but its compiled and run successfully, please tell me the reason
please tell me
please tell me  import java.lang.Thread; class Current{ public static...(); ^ 1 error tell me the resolution please....   import...("current thread"+t); System.out.println("thread name"+t.getName()); } } i got
please tell me
: '}' expected ^ 2 errors, i got this error....... please tell me the resolution...please tell me  class Person{ string name; int age; void...("my age is"+age); } } class Hash(){ public static void main
please tell me
please tell me  Actually i am working on a Project tiitle is JavaMail System, 1)How to configure java mail API and a Demo Program for Sending mail and Receiving using JSP and Servlet
how can i write this program ?please suggest me
how can i write this program ?please suggest me  Program to calculate the sum of two big numbers (the numbers can contain more than 1000 digits). Don't use any library classes or methods (BigInteger etc
please tell me
please tell me  class Sample{ private double num1,num2; void sample...(10.6,20.0); ^ 1 error, please tell me the resolution for this...   ...; System.out.println("sum"+result); } } class Methods{ public static void main(String
please tell me
please tell me  class Producer extends Thread { StringBuffer sb... got error as Inner class connot have static declarations pls tell me... run(){ synchronized(sb){ for(int i=1;i<=10;i++){ try{ sb.append(i
please tell me
please tell me  Blockquote Blockquote> BlockquoteBlockquote how to get images from ms access databases to jsp pagesBlockquote   Jsp get image from ms access database Create a table named user(id,name,address,image
please tell me
; ^ please tell me the resolution   class Reserve...please tell me  class Reserve extends Thread{ int available=1; int wanted; Reserve(int i){ wanted = i; } public static void
please tell me
please tell me  class Person{ int age; String name; void talk...); } } class Hash{ public static void main(String ar[]){ Person raju=new Person...(); } } if i run this prog i get only sita object details, y i cant get both raju and sita
please tell me
please tell me  why we use public static main(String ar){} in java instead of main
please tell me
please tell me  what are the topics in core and advaced java....   Hi Friend, Please visit the following links: http://www.roseindia.net/ http://www.roseindia.net/java/ Thanks   Hi Friend, Please visit
please tell me
please tell me  what is the source code if user give wrong user name..."; System.out.println(vsqlad); ResultSet rs=stmt.executeQuery(vsqlad); rs.next(); String...;script type="text/javascript"> function showData(){ var user
please tell me
:iterate> </logic:notEmpty> </logic:present> how can i...please tell me   <tr> <td><html:hidden property="tid" value="${user.id}"/><
please tell me
please tell me  why we are using http protocol in servlets
please tell me
please tell me  which cmd we use to clear the screen in sql prompt
Software graduates please tell me,
Software graduates please tell me,  How to view image on Frame in swing(or)awt in Java
Software graduates please tell me,
Software graduates please tell me,  How to view image on Frame in swing(or)awt in Java
please tell me
please tell me  select * from emp order by 5 desc; in the above what is the meaning of 5, and what its functionality
please tell anybody how can i set a value in hiperlink for edit n delete link
please tell anybody how can i set a value in hiperlink for edit n delete link  <logic:present name="allRecords"> <logic:notEmpty name="allRecords"> <logic:iterate id="user" name
Can you tell me how it worked?
Can you tell me how it worked?  public class Ball { private static... of this class - 'Ball'? I mean, it should be like ball.getBounds... Rectangle(x, y, DIAMETER, DIAMETER); } } How is the 'getBounds()' method called
please tell me about command line arguments in java?
please tell me about command line arguments in java?  please tell me about command line arguments in java?   Hi Friend, The command-line arguments are the arguments which are sent to the program being called. You can
Can anybody tell me how to resolve this issue?
Can anybody tell me how to resolve this issue?  java.lang.Exception: Exception : java.lang.Exception: Generic Errors = java.util.MissingResourceException: Can't find bundle for base name Connection, locale en_US
please tell me about command line arguments in java?
please tell me about command line arguments in java?  please tell me about command line arguments in java?   Hi Friend, The command-line arguments are the arguments which are sent to the program being called. You can
please tell me the flow of execution of this program
please tell me the flow of execution of this program  class Test{ int x; Test(int x){ this.x=x; } static void access(){ System.out.println("x= "+x); }} class Static{ public static void main(String ar[]){ Test obj=new Test(55
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...
how can create pop() method in this program ,Or how can delete image in it when i press pop button in runtime ??? please help me ...   ...(), and one image removed. how ? } } } ); } class ComboBoxRenderer extends JLabel
Can anybody tell me how to use #parameters in struts 2 ?
Can anybody tell me how to use #parameters in struts 2 ?  I have a login page, And by using struts.xml and #parameters I want to display error.../Login.jsp ADS_TO_REPLACE_1 Its urgent. Pl help me out
How can you tell a fake data scientist?
How can you tell a fake data scientist?  Hi, I am beginner in Data...: How can you tell a fake data scientist? Try to provide me good examples or tutorials links so that I can learn the topic "How can you tell a fake data
How can I get experience in data science if no one would hire me?
How can I get experience in data science if no one would hire me?  Hi... for the tutorials to learn: How can I get experience in data science if no one... learn the topic "How can I get experience in data science if no one would
Tell me - Java Beginners
Tell me   how to create a valid.js file please tell me and give the write code Thanks  Hi friend, Please give details for requirement of this "valid.js" file. For read more information http
Please tell me the code to generate the below structure
Please tell me the code to generate the below structure  1 2 3 4 5 6 7 8 9 1 2 3 4 6 7 8 9 1 2 3 7 8 9 1 2 8 9 1 9 1 2 8 9 1 2 3 7 8 9 1 2 3 4 6 7 8 9 1 2 3
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
i want java code for this xml file...please show me..
i want java code for this xml file...please show me..   xbrli:shares xbrli:pure iso4217:INR
Can i insert image into struts text field
Can i insert image into struts text field  please tell me can i insert image into text field
How can I write a GUI stack program by Java to push Image files instead of other data type items?
How can I write a GUI stack program by Java to push Image files instead of other data type items?   How can I write a GUI stack program by Java to push Image files instead of other data type items? for the push instruction I
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.
How can I access databse through JSP. I am using postgresql-8.4.4-1-windows as database and jboss-4.0.5.GA as server.  I am using postgresql-8.4.4-1... netbeans-6.1-ml-windows.How can I set up connection to database? Please help me
I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way.....
I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please show me my way.....  I want Mini Java Project for Student Admission System. actually i want 2 know how 2 start this...please
I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my... the anagram on screen or the output file! Please show me whats wrong. Thanks i... upon their signature. */ public class Anagram { //Creating constants
tell me i don't know about cms and history - Java Interview Questions
tell me i don't know about cms and history  what is cms,when can it is used ,what are the advantages and what are the more information about CMS
please i want someone to answer me pleeeeeeeeeeeeease...
please i want someone to answer me pleeeeeeeeeeeeease...    Write a JAVA program using 2D array to auto-grade exams. For a class of N students, your... percentage (out of 100%) of each student, and also the class average. Define the exam

Ads