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

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 6 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 initcap(ename),job from emp where substr(job,4,length(job,4,3)))='age
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
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
: '}' 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  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
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
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 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 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 Its urgent. Pl help me out
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 ...   ... (b1) button call pop(), and one image removed. how ? } } } ); } class
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 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
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
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
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
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
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers  how can i add wirecard option(or button ) at my web page plz tell all steps? View Answers
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
how can i create a data grid - Java Beginners
how can i create a data grid  Nice to ur respose...thnks all of u plz help me i want make a datagrid but i have no idea about this how can i create datagrid. and how can i connect to the database plz help me give
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
How can I learn Java?
How can I learn Java?  Hi, I have just completed a course in HTML.... Now I want to learn Learn Java programming and become the expert in Java programming. How can I learn Java? in shortest possible time. I mean I just want to begin
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
How can i pass the valus from a JSP to the action class???
How can i pass the valus from a JSP to the action class???  hewllo wevryone... can anyone help me with how i can pass the value of menuId in my JSP and pass it in the action class
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone
Can any one please help me in this ,,,,,,, need java code for this ,,,,please anyone  The Airport Valet Parking Company (AVP) is a company which provides a convenient medium cost parking solution to users of a local airport. Key
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
 

 

 

DMCA.com