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

 
 


Paritosh Das
Please tell me how I can access a field (data type char) of resultset in a java class
0 Answer(s)      2 years and 4 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.

View Answers









Related Pages:
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
please tell me
please tell me  import java.io.*; class SString{ public static void... error please tell me the resolution... InputStreamReader(System.in)); System.out.println("Enter a char"); String name
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
ResultSet
ResultSet  I want to retrieve data of unknown datatype from database.how to do it using resultset or Resultsetmetadata.Can you please tell me what...="Content-Type" content="text/html; charset=UTF-8"> <title>SQL<
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
:iterate> </logic:notEmpty> </logic:present> how can i...please tell me   <tr> <td><html:hidden property="tid" value="${user.id}"/><
please tell me
, i got this error....... please tell me the resolution...please tell me  class Person{ string name; int age; void talk... age is"+age); } } class Hash(){ public static void main(String ar
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
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 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  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 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
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
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
urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
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
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  why we use public static main(String ar){} in java instead of main
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
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
help me please
help me please  how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks
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
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
Scrollable ResultSet - Java Beginners
Scrollable ResultSet  My Previosly asked question Can u tell how... search_log_tab WHERE visible='v';"; rs=stmt.executeQuery(sqlstmt); How can i... question resolved. First of all thanks for the answer Can u just give
Please help me??
Please help me??  Question_1: Using one-dimension array of primitive type elements. Objective: The purpose of this lab exercise is to practice how to declare, create and manipulate a one-dimension array of primitive type
Tell me - Struts
Struts tutorial to learn from beginning   Tell me, how can i learn the struts from beginning
tell me coding for this
tell me coding for this  Write an application that displays the integer equivalents of the following character...A   Java get Integer value of Character class GetIntValueOfCharacter { public static void main
JTable populate with resultset.
JTable populate with resultset.  How to diplay data of resultset using JTable?   JTable is component of java swing toolkit. JTable class is helpful in displaying data in tabular format. You can also edit data. JTable
plz tell me
plz tell me  how to get no. of times the 'button' is pressed   Here is a java swing code that counts the number of times the button clicked. import javax.swing.*; import java.awt.event.*; public class
Data type in java
Data type in java In this section we will tell you about data type in java. A data type is defined as " type of data that can be stored... type of data, which has an initial value 1. There are two data type in java
JDBC ResultSet Example
) database query results. Through this example you can see how to use ResultSet in the application for accessing data. First we will create a java class...; as: ResultSet rs = stmt.executeQuery(selectquery);  Now we will access data using
please help me?
please help me?  Define a class named Circle with the following properties: List item An integer data field named radius with protected access modifier, and a String data field named colour with private access modifier. Both
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records... compiler and compile your java code. For Inserting Data: import java.sql.*; class
Can someone help me with this?
Can someone help me with this?  I have this project and i dont know how to do it. Can someone help me? please? Write a java class named "PAMA..., Multiply, Divide) Help me please! Thanks in advance!   import
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
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 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
How can i add a new count to this source code ? - Java Beginners
;ZHTYPE (Just Logical) Please tell me how can i see this output? Code...How can i add a new count to this source code ?  Hi everyone I... with this code is true but I want add ZHTYPE at the end of each line + XTSM/XTS please
How can i add a new count to this source code ? - Java Beginners
;ZHTYPE (Just Logical) Please tell me how can i see this output? Code...How can i add a new count to this source code ?  Hi everyone I... + XTSM/XTS please help me ???(for example this : XTSM:0/XTS:0 : 29 TCHF_HLF:28 TCHSD
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
java please please help
java please please help  Dear Friends plz help me to complete this program import java.util.*; public class StringDemo { static...[] to HashMap so that i can seperate key and value using Map.Entry.Please help me!  
Please check it and let me know - Java Beginners
Please check it and let me know  Hi friends, your las suggession... code and requirement please check it and solve again thanks Requirements:- I... the subject c & practical type marks only. I am sending all code. User.jsp
Help me please!!! - Java Beginners
Help me please!!!  im badly needing the complete code for this project in java!!! can you please help me???!!! it is about 1-dimensional array... the answers 8Hours from now!!! Kindly help me!! please!!please!!! NOTE
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
Conversion from String to char
Conversion from String to char: In this tutorial we will learn how to convert a string type data to char type data. Description: This program will take... = mystring.charAt(i); is used to find out the char value at specific index value of i which
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

Ask Questions?

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.