how to close the connection object,statement object,resultssetobject when using the microsoft access a database

how to close the connection object,statement object,resultssetobject when using the microsoft access a database

Hi Friend,

I am developing the webapplication using the jsp(business logice-jsp).backend is microsoft access file. How to close the conection objects,resultset object.objects are increaseing when accessing the jsp page.
View Answers

March 3, 2010 at 3:39 PM

Hi Friend,

Try the following:

<%@page import="java.sql.*"%>
<%
Connection conn=null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn =DriverManager.getConnection("jdbc:odbc:access");
Statement st=conn.createStatement();
ResultSet rs=st.executeQuery("select * from data");
while(rs.next()){
out.println(rs.getString(1)+" "+rs.getString(2)+"<br>");
}
rs.close();
st.close();
Statement st1=conn.createStatement();
ResultSet rst=st1.executeQuery("Select * from Employee");
while(rst.next()){
out.println(rst.getString(2)+" "+rst.getString(3)+"<br>");
}
rst.close();
st1.close();
conn.close();
}
catch(Exception e){}
%>

For more information, visit the following link:

http://www.roseindia.net/jdbc/Jdbc-odbc-connection.shtml

Thanks









Related Tutorials/Questions & Answers:
how to close the connection object,statement object,resultssetobject when using the microsoft access a database - SQL
how to close the connection object,statement object,resultssetobject when using the microsoft access a database   Hi Friend, I am developing the webapplication using the jsp(business logice-jsp).backend is microsoft access
JSF CONNECTION WITH MICROSOFT ACCESS
JSF CONNECTION WITH MICROSOFT ACCESS  HI CAN U PLEASE HELP ME WITH A PROGRAM WHICH SHOWS HOW TO RETRIEVE DATAS FROM MICROSOFT ACCESS.I HAD TO CREATE AN USER INTERFACE USING JSF BY CONNECTING TO MS ACCESS THANKS DEEPAK
Advertisements
why it is very slow when I am using the backend as microsoft access file for running the java webapplication - SQL
why it is very slow when I am using the backend as microsoft access file for running the java webapplication  I am using the backend as microsoft access file for running the java webapplication.it is very slow when twoor mor
Correctly Open and Close database connection
; } Completely Open and Close A Database Connection Database Connection... and close database connections properly. If any database connection is open... important to close the database connection after it is used. Database connection
The JDBC API to access a desktop database like Microsoft Access over the network.
The JDBC API to access a desktop database like Microsoft Access over the network.  How can I use the JDBC API to access a desktop database like Microsoft Access over the network
retreiving data from microsoft access database
retreiving data from microsoft access database  How can i retrieve data from microsoft access when i have select the vaules in combo box and text box. When i select these values... i want to retrieve the corresponding columns
please help me solve this problem when i am create database connection using servlecontext
please help me solve this problem when i am create database connection using servlecontext  hi... I have create a database connection using...("db", db); } //database connection class
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access
close a Connection application
close a Connection application  What happens when I close a Connection application obtained from a connection Pool? How does a connection pool maintain the Connections that I had closed through the application
How to insert or delete records in MS access database using jsp - JSP-Servlet
How to insert or delete records in MS access database using jsp  Hi friends please provide me a solution that i insert or delete record from a database using java server pages. I used the microsoft access 2003 database. PlZ
mysql- microsoft access
mysql- microsoft access  hello, In all your tutorials, you have used Mysql. If instead of mysql i use microsoft access so how will it differ and wat will be the connection steps
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
database connection by using java bean
database connection by using java bean  i need a code for bean class to connect to mysql database. subsequently to use dis bean class whereever i need 2 connect 2 database
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 of ms access with java   Java MS Access database connectivity Follow
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
how to delete specified coloumn from database(MS Access) by using windows application
how to delete specified coloumn from database(MS Access) by using windows application  how to delete specified coloumn from database(MS Access) by using c# windows application
PHP SQL close connection
is closed automatically  when the scripts end. To close connection we... PHP SQL close connection       PHP SQL close connection is used to close a connection between the PHP
Understanding Connection Object
with a database. When we connect to a database by using connection method, we create a Connection Object, which represents the connection to the database... to to establish the connection with the database. This is done by using the method
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc  how to make a radio button selected when retrieving data from database using struts framework and spring jdbc
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local system(same network)... but when its in the server, we r getting null values
Draw graph using jsp without database connection
Draw graph using jsp without database connection  Draw graph using jsp code without database connection
Use JDBC to connect Microsoft Access
Use JDBC to connect Microsoft Access  How to use JDBC to connect Microsoft Access
How to access the database from JSP?
How to access the database from JSP?  Hi, What is the process... database from JSP which explains you how to access the database by embedding... you can access the database by embedding the JDBC code. But this is not the best
how i conditional access the data from database using combo box. - JSP-Servlet
how i conditional access the data from database using combo box.   i have combox box named class when i select its value 11 or 12, another combo box... access the data from database when i select class 11 0r 12. Here is JSP file
JAVA DATABASE CONNECTION WITH JTABLE
JAVA DATABASE CONNECTION WITH JTABLE  HOw To Load Database Contents From Access Database to JTable without using Vector
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
server database connection - JSP-Servlet
" in that case how we will get the database connection   Hi Friend... to the database by using the following steps 1.Class.forName("sun.jdbc.odbc.JdbcOdbcDriver... ODBC For Oracle}","scott","tiger"); But how to get the connection from
Connection to Database
is that Joomla is also using MySQL. The question is that why I get error messages when I manually make a connection to MySQL database in my web pages? How joomla... is the code how I am connecting to MySQL: I am connection to MySQL database in 2
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver
Updating Ms Access Database using jsp - JSP-Servlet
Updating Ms Access Database using jsp  Hi I am new to jsp and I am trying to update a record in an access database. I only want to update part of the record because the other columns already have data. When I use Update
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
Using C# DataGridView to insert record into Microsoft SQL Server 2005 database - SQL
creating a sales database system using C# and Microsoft SQL Server 2005. I had encounter a problem of using C# DataGridView to insert record into Microsoft...Using C# DataGridView to insert record into Microsoft SQL Server 2005
Access all the fields from table through JSP
a connection by using Connection interface Connection connection = null; // declare object of Statement interface that is used...;com.mysql.jdbc.Driver").newInstance(); /* Create a connection by using
importing CSV data into Database in java when the no of columns are known using javacsv
importing CSV data into Database in java when the no of columns are known using javacsv   I have imported CSV data into postgres Database in java using javaCSV jar. But now i have to convert it in such way
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
how to connect java with ms access using odbc in eclipse
how to connect java with ms access using odbc in eclipse  import..."); //Connection con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.accdb)};DBQ=student.accdb","",""); Connection con
How to view database for user when they login in netbeans and mysql?
How to view database for user when they login in netbeans and mysql?  I create a web page where when user login they have to fill in a form, after... database with jdbc connection. thanks for your help
to access value of drop down value in beans when dropdown is populated using ajax
to access value of drop down value in beans when dropdown is populated using ajax  i want to access value of dropdown box in beans .. and this drop down was filled using ajax. plz help
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...:access","",""); Statement stmt=con.createStatement(); ResultSet rs
Error in connecting to the mySQL database in TOMCAT using more than one PC (database connection pooling)
Error in connecting to the mySQL database in TOMCAT using more than one PC (database connection pooling)  how do i implement connection pooling...(); I was able to successfully connect using one PC. But when I use another PC
DataBase Connection
DataBase Connection  How to connect java and Oracle 10g? Tell me Jdbc connection
how to access windows registry information using java?
how to access windows registry information using java?  can any one help me how to access windows registry information using java
how to close JSF application..?
how to close JSF application..?  how to close jsf appliaction using command button with help of java code
How to create a jar file with database connection
How to create a jar file with database connection  Hello Everyone!!! Pls Help me in this... i have a program which has a database connection with ms access & i want to create a jar file of it... I have tried with manifest
J2ME with Database Connection - MobileApplications
J2ME with Database Connection  I'm using SonyEricssion Java ME SDk for CLDC with WTK2. Can u give me a sample program for Database Connection using MS-Access with MIDlet code
How To Connect MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
database connection
database connection  hi all ready created database table using mysql database,employee payroll,attendance,employee details used database i need how to import and export excel file into database using jsp? pls help me any one
Connect database in Access to Netbean?
Connect database in Access to Netbean?  how to connect database in micrsoft access to Netbean?i know it can be connected by using JDBC-ODBC bridge, can i know the steps in connecting the database? Is there any source code
How to save JCombobox Selected Item in to Access Database - Java Beginners
How to save JCombobox Selected Item in to Access Database  How...:access","",""); Statement stmt=con.createStatement(); ResultSet rs... =DriverManager.getConnection("jdbc:odbc:access","",""); Statement stmt=con.createStatement(); int i

Ads