Home Answers Viewqa JDBC retreive integer data from database

 
 


lalit rajak
retreive integer data from database
0 Answer(s)      a year and 5 months ago
Posted in : JDBC

i made a table named result having two fields 1>rollno 2>marks i creates a gui where i use a textfield and two buttons "ok" and "cancel" i want to take input from textfield as an integer(rollno) and the marks associated with that must be displayed.i write the following code but the error appears is "no specific value for parameter 1" so please suggest me where t am wrong. coding written in "ok" button

public void actionPerformed(ActionEvent e){ if(e.getSource()==b1){ try{

       Class.forName("com.mysql.jdbc.Driver");
      Connection cn=DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb" +

"?user=root&password=lalit&database=mydb");

      String url="select marks from student where rollno=?";
      PreparedStatement stmt=cn.prepareStatement(url);
      ResultSet rs=stmt.executeQuery();
 stmt.setString(1,tf1.getText().toString());

int n=Integer.parseInt(rs.getString(2));

System.out.println("Your marks is "+ n); stmt.close(); cn.close(); } catch(Exception ex){ JOptionPane.showMessageDialog(null, ex);

                      }

                                         }

if(e.getSource()==b2){ this.dispose();

              }

}

}

View Answers









Related Pages:
retreive integer data from database
retreive integer data from database  i made a table named result...=lalit&database=mydb"); String url="select marks from student where rollno... and two buttons "ok" and "cancel" i want to take input from textfield
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  sir am doing project in ASP.NET useful for my college that is placement portal...please help in display details of particular student after he login ...i want
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  hi I m developing a project on hospital management and I m not able to retrieve the user information.. now their is a login and registration page for newuser
How retreive data from database without using post method in jsp - JSP-Servlet
How retreive data from database without using post method in jsp  Tell me how?  Hi Friend, If you don't want to use post method then use... the selected value from the combo box and get textbox value from another page
How to retreive data by using combo box value - JSP-Servlet
How to retreive data by using combo box value  I am using a single jsp form.. i did not get from another form.. i do not use 2 jsp form.. all... there... /// Here stored Combobox values from database
how to retreive values from MS Access Database based on the values entered in textbox values in jsp file
how to retreive values from MS Access Database based on the values entered... Solution field from database and display in the textbox of the jsp.   1... * from item where itemid='"+id+"'"); while(rs.next()) { data = ":" + rs.getString
how to retreive data dynamically from mysql to drop down list
how to retreive data dynamically from mysql to drop down list   sir... fron end using jsp , after storing the data successfully .i want to retrieve the data of a particular column in a table into drop down list dynamically
How to retreive data by using combo box value - JSP-Servlet
How to retreive data by using combo box value  Hello friend , i am using only one form. U are using html form and jsp form. So get the values from html. So u r using if(request.getParameter("cid")!=null
retrieve data from mysql database and store it in a variable ?
retrieve data from mysql database and store it in a variable ?  sir , I am working on a project , in which I have to apply operation on input data... that retrieve the integer values from the database and stored in the integer
selecting data from database
selecting data from database  how to select data from database using Dao in struts   Hi, You have to load the data from database using hibernate and send the data in a Java file object to jsp page. Please read at http
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
retrive data from database?
retrive data from database?  hellow i have a database sheet name as db1. it's contain sixty(60) sn,name ,rollno(primary key),father's name etc... from db1 and enter value in text box according there name,rollno and save
Convert Hexadecimal number into Integer
to convert hexadecimal data into integer. The java.lang package provides the functionally to convert the hexadecimal data into an integer type data.  Code Description: The following program takes an integer type data at the console
Integer exception in java
Integer exception in java       The integer class is a wrapper for integer value... want to store an integer in a hash table, you have to "wrap" an Integer
fetch data from database in javascript
fetch data from database in javascript   How to fetch data from database in JavaScript when it is a leap year
delete data from database - SQL
delete data from database  HOw to delete specific data from table> I want to delete one record from database. Thnx  Hi friend, -------------------------------------------- Visit for more information
To retrive data from database - Struts
To retrive data from database  How to get values ,when i select a select box in jsp and has to get values in textbox automatically from database? eg... come to jsp page automatically from database
Problem in accessing data from Database
Problem in accessing data from Database  hi..... i'm making a project on servlet and jsp with ms access 2007 at the backend. One field in my database is text and all others are of currency data type. If i enter 0 or null value
retrieve data from database with hyperlink
retrieve data from database with hyperlink  sir....i have one table called 'name' having two values i have to retrieve those data with a hyperlink and show in browser and if we click hyperlink its shows his sub categories....how
retrieve data from mysql database
retrieve data from mysql database  hi am not familiar in php.....even... selected value on combobox which is to be retrieve the relevant data from mysql database using php.... below my code is that.. <html> <head>
Getting Textbox data from database
data from database and display it on the textboxes. <%@page language="java...Getting Textbox data from database  When i m trying to get data in textbox as readonly from database i m getting following error.and my code is shown
GWT -- retrive the data from Database
GWT -- retrive the data from Database  the user can create an event. In the create page, we have three buttons. Save as draft, preview and save... button, you have to create a dynamic jsp which should read the contents from
Getting Textbox data from database
;Here is a jsp code that retrieves data from database and display...Getting Textbox data from database  When i m trying to get data in textbox as readonly from database i m getting following error.and my code is shown
Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list... from the dropdown, related data will get displayed on the textboxes. Here we have
store data from a variable in mysql?
store data from a variable in mysql?  sir last time asked you tell me how to retrieve data from a database mysql and store it in an int variable... of the calculation from an int variable into mysql in a new table of database. how
how to display data from database in jsp
how to display data from database in jsp  how to display data from database in jsp
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
the unread mails in database. 4)retrieve the unread mails from my database... connectivity to store unread mails and retreive it..  Dear sir
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
the unread mails in database. 4)retrieve the unread mails from my database... connectivity to store unread mails and retreive it..  Dear sir
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
the unread mails in database. 4)retrieve the unread mails from my database... connectivity to store unread mails and retreive it..  Dear sir
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
the unread mails in database. 4)retrieve the unread mails from my database... connectivity to store unread mails and retreive it..  Dear sir
code to validate username password of gmail and procedures to establish jdbc connectivity to store unread mails and retreive it..
the unread mails in database. 4)retrieve the unread mails from my database... connectivity to store unread mails and retreive it..  Dear sir
store and retrive image from the database
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...store and retrive image from the database  please provide me
accept integer from user
accept integer from user  Write an Java application that accepts 100 integer numbers from a user. The input should be in the range of 1-200. Error message needs to be displayed if user entered input which is not in this range
how to use bean to retrieve data from database
how to use bean to retrieve data from database  how to use bean to retrieve data from database   poda sendru
Retrieval data from database against timer
Retrieval data from database against timer  Please send me a sample timer code which retrieve data from the database against timer in JSP
data insertion from xml file to database table
data insertion from xml file to database table  Hi all, I have data in the XML file. I need to insert it into table in the database using servlet. so please reply me . ThankYou
On Click on Submit Button Display Data on Orderlist
On Click on Submit Button Display Data on Orderlist  How can retreive data from database on orderlist on Click on submit Button of same page
to fetch data from ms word and storing into database
to fetch data from ms word and storing into database  i want to know how to fetch datafields from ms word and storing into database??? please answer soon .its urgent
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
display data from database on selecting option of dropdownlist
display data from database on selecting option of dropdownlist   Sir I want to display data from database by just selecting option of dropdown list... is that to display image from database in a grid format or in a fixed column and row
retrieve data from database using jsf
retrieve data from database using jsf  Hello I want an example of source code to retrieve data from database i have a database (oracle) name as db1 it's contain table 'author' composed of three columns idauthor(primary key
integer to string
integer to string  i have to develop a program which convert integer into character from 1 to 10,000 if we input 1 then it give output 'one' n so on till 'ten thousand' kindly give me the codes plzplz sir........   Have
Retrieve multiple data from database into Table.....
Retrieve multiple data from database into Table.....   hi........... I want to Retrieve multiple data from database into Table but i am not able... database i have attributes pH, phosphate, ....... month, year......... so its
Display Data from Database in JSP
, to show data from the database click on the link that calls another .jsp file named...;body> <h2>Data from the table 'stu_info' of database 'student'</h2...; <html> <head> <title>display data from
insert and delete data in database
insert and delete data in database  insert and delete data in database from servlets through JDBC   Hi Friend, Please visit the following links: Insert Data Delete Data Thanks
Saving data in database
Saving data in database  hello i m facing a strange problem if i am submitting data form database then i can see it in database but if am submitting from app then it is not showing in to database but when i fetching form
Select data from Table in Database
Select data from Table in Database   ... the selected data from table in database. The select query in the database retrieve... in the specified table. The Keyword from indicates the table, from where the data
database
database  use of hyperlink to show the data from database

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.