Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Please tell me how I can access a field (data type char) of resultset in a java class
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Paritosh Das
Please tell me how I can access a field (data type char) of resultset in a java class
0 Answer(s)      3 years and 9 months ago
Posted in : Java Beginners


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.


Advertisement
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
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 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
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
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
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
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
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
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
: '}' 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
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
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  why we use public static main(String ar){} in java instead of main
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 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  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
: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  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 are using http protocol in servlets
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
please tell me  which cmd we use to clear the screen in sql prompt
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
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
 

 

 

DMCA.com