correct the sql error and retrive data....plez

correct the sql error and retrive data....plez

i am getting a SQL Error while retriving data from access to jframe called "datatype mismatch in criteria expression" plez do help me and studentId's datatye is number......

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
     if(jTextField1.getText().equals(""))
 {
     JOptionPane.showMessageDialog(null,"Please enter the Student ID to Search","Error",0);
 }
 else
 {
     try
     {
         String ID=jTextField1.getText();


         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection con=DriverManager.getConnection("jdbc:odbc:college");
         Statement st=con.createStatement();
            ResultSet rs=st.executeQuery("select * from STUDENT where studentid='"+ID+"'");

            while(rs.next()){
            jTextField1.setText(rs.getString("studentid"));
            jTextField2.setText(rs.getString("name"));
            jComboBox1.setSelectedItem(rs.getString("course"));
            jComboBox2.setSelectedItem(rs.getString("sem"));
            jTextField4.setText(rs.getString("father"));
            jTextField5.setText(rs.getString("mother"));
            jTextField13.setText(rs.getString("dob"));
            jTextField6.setText(rs.getString("contactno"));
            jTextField7.setText(rs.getString("nationality"));
            jTextField8.setText(rs.getString("religion"));
            jTextField9.setText(rs.getString("caste"));
            jTextArea1.setText(rs.getString("address"));
            jTextField10.setText(rs.getString("foccupation"));
            jTextField11.setText(rs.getString("moccupation"));
           jTextField12.setText(rs.getString("income")); 

            }
            JOptionPane.showMessageDialog(null,"Searched Successfully");
            rs.close();
            st.close();
            con.close();
     }
    catch(SQLException sqlex)
     {
        JOptionPane.showMessageDialog(null,"SQLExceptionOccurred"+sqlex.getMessage());
     }
     catch(ClassNotFoundException cnfex)
     {
         JOptionPane.showMessageDialog(null,"ClassNotFoundExceptionOccurred"+cnfex.getMessage());
     }
 }

}

plez plez plez help me its my assignment....... and thanks for all your help.....

View Answers









Related Tutorials/Questions & Answers:
correct the sql error and retrive data....plez
correct the sql error and retrive data....plez  i am getting a SQL Error while retriving data from access to jframe called "datatype mismatch in criteria expression" plez do help me and studentId's datatye is number
correct the sql error
correct the sql error  i am getting a SQL Error while retriving data from access to jframe called "datatype mismatch in criteria expression" plez do...(null,"Please enter the Student ID to Search","Error",0); } else { try
Advertisements
what error in this program plese correct it
what error in this program plese correct it  import java.io.*; class y { public static void main (String args[]) { Data inputStream dis = new Data inputstream(System.in); float l,b,a; Systyem.out.println("enter the lengh"); l
java [ cannot retrive date from sql ] why??
cannot I retrive data from bd even if I put correct data in it if( rs.next...java [ cannot retrive date from sql ] why??   import...(); } }   Hi, Try to print the sql on console and then run
insert and retrive data and time - SQL
insert and retrive data and time  hello everybody . Is there any method in java so that we can insert current system time and then it can be retrieve that date and time from database ? ..........................  
SQL Error - SQL
SQL Error  Invalid character value for cast specification on column number 5 (Designation) Whats this error about this if the field i specified in programming error. ie DB fields in above question
insert and retrive image from sql server database in jsp
insert and retrive image from sql server database in jsp  what is the code to insert and retrive an image from sql server database in jsp
SQL Error Version 5.5.15
SQL Error Version 5.5.15  SQL Error Version 5.5.15
retrive article from sql databse and show using php
retrive article from sql databse and show using php  hello sir i have sql database which i store articles.i want to show these article on web page using php. my field are image,title,summary,content id. plz provide me
SQL connection error in android
SQL connection error in android  hi, i am android developer . recently i made one application connect with sql server 2005 using jtds...:sql:Exception : BUFFERDIR connection property invalid. if you have any answer
sql syntax error help
sql syntax error help  this query show syntax error .. i am unable to figure it out insert into order (orderdate, dpname, paymethod, tamount...') where is the error ?   Please send the error details and the datatype
error : not an sql expression statement
error : not an sql expression statement  hii I am gettin followin error in connecting to database SQLserver 2005 in Jdeveloper,i m usin struts and jsp my pogram: import java.sql.*; public class TaskBO { public TaskBO
JSP SQL Error
JSP SQL Error  Hi While trying to execute the below code i'm getting the following error "java.sql.SQLException: Io exception: Got minus one from a read call ". please help me out. <% try{ String Username
SQL QUERY ERROR
SQL QUERY ERROR  Im writing a query which shows error of INVALID..._UserType+",'"+user_password+"');"; AND THE DATA WHICH IS INSERTED FROM THE FORM IS THROWING THE ERROR OF INVALID CHARACTER BUT THE SAME QUERY IS RUNNING
SQL error - JSP-Servlet
SQL error  Hello friends, Can we update a column with referrence to that column value. For example, the query...){ System.out.println("Error occured while updating!!!"); } con.close
hibernate sql error - Hibernate
hibernate sql error  Hibernate: insert into EMPLOYE1 (firstName, lastName, age, p-type, EMP_ID) values (?, ?, ?, 'e', ?) Exception in thread "main.../index.shtml http://www.roseindia.net/hibernate/insert-data-database.shtml Hope
foreign key error in sql
foreign key error in sql  create table matchdetails(mid varchar2(10),mdate date,team1 varchar2(10),team2 varchar2(10...) references matchdetails(mid)); ->for the above batsman table it shows error
plz check my codings are correct or not...There is an error..i cant find it..
plz check my codings are correct or not...There is an error..i cant find it..  import java.util.Scanner; public class Student { private String indexNo; private String gender; private char initial; private int mark1
How to trap Trigger Error - SQL
problem?.. Is there a way in where I can trap all SQL error and place it under... error_log ( timestamp DATETIME, username NVARCHAR(30), ErrorID INT, database_name NVARCHAR(50), error_stack
My Sql Error - Development process
My Sql Error  Hello Sir ,I have Created Table with following Query,then Table Created Succefully,But some errors Occured, can u give me the Code with Microsoft Access As BackEnd Application in this Project . plz Help me Sir
Error while SQL Server connection to Java
Error while SQL Server connection to Java  import java.sql.*; public..."); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER;user=DTHOTA;password...("password", " "); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER", prop
Error while SQL Server connection to Java
Error while SQL Server connection to Java  import java.sql.*; public..."); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER;user=DTHOTA;password...("password", " "); con=DriverManager.getConnection("jdbc:odbc:SQL_SERVER", prop
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement  Dear Sir ,I have write following code to save data into access databse, but code gives following error code...)values(?,?)"); Error: java.sql.SQLException: [Microsoft][ODBC Microsoft
MY Sql Query Error - Not able to Understand the issue
MY Sql Query Error - Not able to Understand the issue  I am new... END I am getting an error as follow: Schema Creation Failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server
Java servlet sql connectivity error - JSP-Servlet
to store data into sql database the connection does not get established. I am...Java servlet sql connectivity error  Hi, I have been trying to connect to sql database via the servlet program in java.I have not been
syntax error in SQL Insert Statement - Java Beginners
syntax error in SQL Insert Statement   private class ButtonListener implements ActionListener{ public void actionPerformed(ActionEvent ae...); stm.executeUpdate();*/ JOptionPane.showMessageDialog(null,"Data
Retrive Values
Retrive Values  I want to retrive the values between the td by the id using the javascript.So please help me... html form like this <TABLE...; </TABLE> And I want to retrive Cell 1,Cell 2,Cell 3
File Upload and Retrive files
File Upload and Retrive files  Can any body help me am getting an error in uploading file. into mysql database.... thank's in advance
Java Compilation error - SQL
store and retrive image from the database
store and retrive image from the database  please provide me... to store and retreive images from sql database using sql commands -how to store and retreive images from sql database using asp.net/c# thanks in advance
error
/ServletUserEnquiryForm.shtml getting an error given below SQLException caught: [Microsoft][ODBC SQL Server Driver]COUNT field incorrect or syntax error please suggest...error  I am running a program insert into statement in sql using
how to retrive
; it's not working..ple anybody can correct is code
retrive values - JSP-Servlet
retrive values  how to get multiple values from html to jsp
ModuleNotFoundError: No module named 'correct-horse'
'correct-horse' error? Thanks   Hi, In your python...;correct-horse' error will be solved. Thanks...ModuleNotFoundError: No module named 'correct-horse'  Hi, My
ModuleNotFoundError: No module named 'correct_pycountry'
named 'correct_pycountry' error? Thanks   Hi, In your...: No module named 'correct_pycountry' error will be solved. Thanks...ModuleNotFoundError: No module named 'correct_pycountry'  Hi, My
ModuleNotFoundError: No module named 'reynir-correct'
'reynir-correct' error? Thanks   Hi, In your python... 'reynir-correct' error will be solved. Thanks...ModuleNotFoundError: No module named 'reynir-correct'  Hi, My
ModuleNotFoundError: No module named 'correct-horse'
'correct-horse' error? Thanks   Hi, In your python...;correct-horse' error will be solved. Thanks...ModuleNotFoundError: No module named 'correct-horse'  Hi, My
ModuleNotFoundError: No module named 'correct_pycountry'
named 'correct_pycountry' error? Thanks   Hi, In your...: No module named 'correct_pycountry' error will be solved. Thanks...ModuleNotFoundError: No module named 'correct_pycountry'  Hi, My
retrive mails - Java Beginners
retrive mails   hi how to retrive mails using mysql in java not using pop3 or imap directly from database i am using dbfile system in james server.header should be store in database and message in file system thanks bala
retrive values - JSP-Servlet
retrive values  how to retrive multiple values from html to jsp  Hi Friend, Try the following code: 1)calljsp.html: Enter Name: Enter Address: Gender:MF Qualification: Btech MBA MCA MSC
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern
Error
Error  Hi. I am getting error in the following code after the line I have commented as ERROR. How to solve this. Thanks in advance. package...;"); // ERROR out.println(" var pattern = /^\d{3,5
retrive data from database?
retrive data from database?  hellow i have a database sheet name..... now i want retrive sn,roll no and name and textbox like....,rllno,and name retrive
retrive data from database
retrive data from database   hi.. i made a application form. it's have attribute s.no,name,roll no and i enter a few records. now i want to view all record not in database access sheet i want to view it at any another
image retrive into DataBase - JDBC
image retrive into DataBase  Dear Deepak Sir, How to retrive the image into DataBase. Thanks & Regards, VijayaBabu.M  Hi, Retrieving image from database is easy task. JDBC provides all the necessary API
error
error  while iam compiling iam getting expected error
Error-
Error-   Hello, I would like to know about XSD file. I try to print XML file but I am getting error SAXException-- says Content is not allowed in prolog. Please help me
error
error  i have 404 error in my program plz tell me yhe solution about

Ads