Scrollable ResultSet



Share on Google+Share on Google+

Shibin Varghese
Scrollable ResultSet
1 Answer(s)      9 years ago
Posted in : Java Beginners
View Answers

August 25, 2008 at 1:53 PM

Hi friend,

<%@ page language="java" import="java.sql.*;"%>

System.out.println("MySQL Connect Example.");
Connection conn = null;
String url = "jdbc:mysql://localhost:3306/";;
String dbName = "databasename";
String driver = "com.mysql.jdbc.Driver";
String username = "";
String userPassword = "";

int count=0;

try {
conn = DriverManager.getConnection(url+dbName,username,userPassword);

Statement stcount = conn.createStatement();
String strQuerycount = "select count(*) from tablename";

ResultSet rscount = stcount.executeQuery(strQuerycount);
count = rscount.getInt(1);
catch(Exception e)

out.println("No. of Records " + count);



Related Tutorials/Questions & Answers:
The cursor in scrollable resultset
The cursor in scrollable resultset   How to move the cursor in scrollable resultset
Scrollable ResultSet - Java Beginners
Scrollable ResultSet  My Previosly asked question Can u tell how to get the count of records. in a select operation like sqlstmt="SELECT * FROM... get the number of record for the Query. Your Answers use the scrollable
ResultSet   What is a ResultSet
ResultSet  What is a ResultSet
ResultSet  I want to retrieve data of unknown datatype from to do it using resultset or Resultsetmetadata.Can you please tell me what... = con.createStatement(); ResultSet rs = st.executeQuery
JDBC ResultSet Forward Type Example
JDBC ResultSet Forward Type Example: Through this ResultSet type the cursor only move forward in the result set and are non-scrollable. The following... only ResultSet object. Statement stmt = connection.createStatement
How to make selectOneMenu scrollable
How to make selectOneMenu scrollable  how to make the selectOneMenu scrollable? I have around 20 values in drop down and i want the scrollable functionality after 5 values. Kindly reply as soon as possible. Thanks Shikha
multiple resultset in one resultset
multiple resultset in one resultset  how to retrive multiple resultsets in one resultset in java.? plz help
resultset metadta
resultset metadta  import java.sql.Connection; import... Employee Details Using resultset metadata: "); Connection con = null...(); ResultSet rs = st.executeQuery("SELECT * FROM employee
Creating a Scrollable JTable
Creating a Scrollable JTable : Swing Tutorials ... section, you will learn how to create a scrollable JTable component. When any.... The JScrollPane provides you to scrollable facility to scroll the scroll bar
Update a resultset programmatically
Update a resultset programmatically  How to update a resultset programmatically
Resultset - JSP-Servlet
Resultset  I am writing while({} but if resultset is null then it cannot enter in while block. I want,if resultset is null then it will enter into the while block.  Hi friend, A ResultSet object
SQL exception, Exhausted ResultSet
SQL exception, Exhausted ResultSet  javax.servlet.ServletException: java.sql.SQLException: Exhausted Resultset iam getting this error messege whenever i run my code. what would be the possible reasons
resultset problem - JSP-Servlet
resultset problem  hi I have one problem with resultset? ResultSet rs=st.execute("select subjname,staffname from staffdetails"); while... is java.sql.SQLException: Operation not allowed after ResultSet closed how
JTable populate with resultset.
JTable populate with resultset.  How to diplay data of resultset...) JTable(Vector data, Vector columneNames) Here is a JTable populate with resultset...(); ResultSet resultSet = statement.executeQuery(sql
Resultset Issue in SQL
Resultset Issue in SQL  when i call in my code it is returning false, though im having valid query to execute and fetch a row from can i resolve this issue. My code is: SELECT JOBDESCRIPTION,CATEGORY
Resultset with one to many relationship
Resultset with one to many relationship   Suppose there are 5 tables in database named A,B,C,D and E. A has one to many relationship with B,C,D and D... populate my bean classes from resultset without using hibernate, so
JSP - Resultset - JSP-Servlet
JSP - Resultset  hello sir, how can i count record in jsp. i use resultset in my jsp so in my login form how can i check the username and password is correct or not...?? please reply it's urgent.. thanks
large resultset values - SQL
large resultset values  i have one query which will bring more than one lakh records from database(total records are abt 3 crores). While getting the details i'm getting error like
ResultSet In Java
ResultSet In Java In this section we will learn about the ResultSet in Java... that are mostly used in to get the value. ResultSet contains the data of a table after executing the SQL queries. Object of ResultSet also maintains the current position
receive a ResultSet from a stored procedure
receive a ResultSet from a stored procedure  How do I receive a ResultSet from a stored procedure
ResultSet object initialization - Java Beginners
ResultSet object initialization  How to initialize resultset object  Hi friend, public interface ResultSet A ResultSet object maintains a cursor pointing to its current row of data. A default ResultSet object
JDBC ResultSet first() Example
JDBC ResultSet first() Example: The ResultSet first() are use to moves the cursor to the first row in the ResultSet object. It return true if the cursor pointed first row in the ResultSet and return false if the ResultSet object does
JDBC ResultSet last() Example
JDBC ResultSet last() Example: The ResultSet last() are use to moves the cursor to the last row in the ResultSet object. It return true if the cursor pointed last row in the ResultSet and return false if the ResultSet object does
Printing Values of Resultset to Html Table
Printing Values of Resultset to Html Table  I have a resultset and I need to collect the resultset values into the arraylist into a table... in advance   JSP Display values of ResultSet to HTML table: <%@page
Getting ResultSet size - JSP-Servlet
Getting ResultSet size  Hello friends, what is the result getFetchSize() of resultset. I got error with this method. While rs contains... the driver. It has absolutely no effect on the number of rows in a ResultSet. The driver
How to make a horizontally Scrollable grid in jsp using div, table, css, javascript?
How to make a horizontally Scrollable grid in jsp using div, table, css, javascript?  In a jsp page InsertUpdate.jsp (say) there is a button Insert... distorted to accommodate 30 fields.How can I make it Horizontally scrollable
Spring JdbcTemplate and ResultSet is too slow..
Spring JdbcTemplate and ResultSet is too slow..  Hi.. I am using spring jdbctemplate to fetch the records from oracle database. But it is taking too long time to execute a simple select query. The query which is having 400
Moving Cursor within ResultSet
; } Moving Cursor Within ResultSet There are many methods are given to move... = null; // Statement reference variable for query // Execution ResultSet resultSet = null; // ResultSet reference variable for saving query // result
JDBC Updateable ResultSet Example
; } Updateable ResultSet Example You can update the database table using result set. To update the table using result set you need to set the ResultSet... illustrate how to update table through resultset. package
JDBC ResultSet Scroll Sensitive Type Example
JDBC ResultSet Scroll Sensitive Type Example: Through this ResultSet type... the statement object to create a Scroll-Sensitive, read only ResultSet object..., ResultSet.CONCUR_READ_ONLY); package ResultSet; import