pradeep
how to close the connection object,statement object,resultssetobject when using the microsoft access a database
1 Answer(s)      6 years and 6 months ago
Posted in : SQL
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.

Ads

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
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
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
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
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
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
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
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
PHP SQL close connection
automatically  when the scripts end. To close connection we use mysql_close... PHP SQL close connection       PHP SQL close connection is used to close a connection between the PHP
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
Use JDBC to connect Microsoft Access
Use JDBC to connect Microsoft Access  How to use JDBC to connect Microsoft Access
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
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 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
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
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
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
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... the Connection object for the following things: 1). It creates the Statement
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
Draw graph using jsp without database connection
Draw graph using jsp without database connection  Draw graph using jsp code without database connection
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 close JSF application..?
how to close JSF application..?  how to close jsf appliaction using command button with help of java code
JAVA DATABASE CONNECTION WITH JTABLE
JAVA DATABASE CONNECTION WITH JTABLE  HOw To Load Database Contents From Access Database to JTable without using Vector
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
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
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 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
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
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

Ads

Advertisement