Home Answers Viewqa JDBC close a Connection application

 
 


Clark
close a Connection application
1 Answer(s)      2 years and 7 months ago
Posted in : JDBC

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?

View Answers

November 15, 2010 at 10:33 AM


Hi friends,

It is the magic of polymorphism, and of Java interface vs. implementation types. Two objects can both be "instanceof" the same interface type, even though they are not of the same implementation type.

When you call "getConnection()" on a pooled connection cache manager object, you get a "logical" connection, something which implements the java.sql.Connection interface.

But it is not the same implementation type as you would get for your Connection, if you directly called getConnection() from a (non-pooled/non-cached) datasource.

So the "close()" that you invoke on the "logical" Connection is not the same "close()" method as the one on the actual underlying "physical" connection hidden by the pool cache manager.

The close() method of the "logical" connection object, while it satisfies the method signature of close() in the java.sql.Connection interface, does not actually close the underlying physical connection.

Thanks.









Related Pages:
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
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
PHP SQL close connection
PHP SQL close connection       PHP SQL close connection is used to close a connection between the PHP... 'PHP SQL close Connection'. To understand and grasp the example we include
how to close JSF application..?
how to close JSF application..?  how to close jsf appliaction using command button with help of java code
JDBC Prepared statement Close
( ),that close the connection between url  and database.Finally the print ln print... JDBC Prepared statement Close     ... an example from JDBC Prepared Statement Close. In this program, the code describe how
Understanding Connection Object
Understanding Connection Object       A Connection object represents a connection with a database. When we connect to a database by using connection method, we create
JDBC connection
connection implements a connection with database in front end application... Jdbc Connection, We have a list of method required to connect and close... ( ) : An object of connection is used to close the connection between database
Tag In Project POM To Close My Java Application If JRE 1.6 Is Not Found?
Tag In Project POM To Close My Java Application If JRE 1.6 Is Not Found?  I have an application compiled in Java. I build my code through Maven. I... run-time, it should not allow my Java application to launch. Can I get any
JDBC-Odbc Connection
;New Connection Create..."..The Connection object call a close ( ),return you... JDBC-ODBC Connection       JDBC-ODBC Connection is a JDBC driver that translates the operation
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... file. How to close the conection objects,resultset object.objects are increaseing
Connection pooling
get the database connection and use and then close (returned to the pool...Connection pooling  hii, What is Connection pooling?   hello, Connection pooling is a technique used for sharing server resources among
can modify this application connection with database
can modify this application connection with database   hi i'm want... to Java Frame, in here can i ask one more question about using this application modify connection with database ? import javax.swing.*; import java.applet.
Configure JMS connection factories and destinations
Configure JMS connection factories... of database connectivity and messaging within IBM WebShpere Application Server Next    Configure JMS connection factories
Connection to Database
Connection to Database  Hello, I have a website with more than 50.... However, most of times my web pages displays the error message" Too many Connection... and viewing hundreds of pages, I wont get any connection error and the truth
Interact with connection pools to obtain and release connections
. In most cases, the connection does not close... it by serializing your access to the managed connection. If you always close your connection handle before getting another, or close your handle before
Setting the close button operation for the frame in Java
will learn how to implement the close button of any frame or window in java application. By default the close button of the frame is not in working state. If you... Setting the close button operation for the frame in Java
Connection using Jdbc-odbc bridge Driver
bridge driver create connection between java application and 'MSAccess database'. After creating connection it also execute query. Description...Connection using JDBC-ODBC bridge driver JDBCExample.java
Regarding connection between sqlserver 2005 and android application
Regarding connection between sqlserver 2005 and android application  hi to all, i want to know how to create webservice to connect sqlserver 2005 and android. can you please help me by providing source code for ref.. thanks
Java-Connection Pool - JDBC
Java-Connection Pool  How can I create a connection pool. My database is MS SQL server 2000(username-sa, pwd-admin) and my application server is Weblogic 8. Which is the best approach to create a connection pool? Kindly help
connection error - WebSevices
connection error   while conncting a tool(jet profiler for my sql 1.0 released) with my running application ,it reflects following error: connected,but failed to login,read time out
Connection pooling - JDBC
Connection pooling  what is meant by connectio pooling and how...;connection pooling concept basically deals with the pool of object. In every application server will maintain the pool of objects. Depend upon the loading
connection pooling - JDBC
a predetermined number of Connection objects.A client application would...connection pooling  how to manage connection pooling?   Hi friend, A connection pool is a cache of database connections maintained
Sql Connection is not creating
Sql Connection is not creating  Hi i am developing an web application..for that i am using excel as database. To connect for database am using jdbc... it is creating sql connection and allwoing me to access excel but when i am
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
Connection
Connection  What is Connection
Connection pooling - Java Beginners
Connection pooling  Respected Sir/Madam, I have developed an application and I am now trying to implement the same through connection pooling. I have totally 6 files in that application viz Login.jsp, check.jsp, Ahead.jsp
connection
connection   how to make multiple database connection using jdbc
JDBC Connection Pool
application will give you improved performance if you use the JDBC Connection...JDBC Connection Pool In this section we will learn about JDBC Connection Pool and see how to use Apache DBCP for creating the database connection pool. We
struts2-db connection error - Struts
struts2-db connection error  i m unable to connect to the database in one of my application using struts2???These concepts are pretty new to me..so i wanted to know where the problem would hav occured?  Hi Friend
java connection - JDBC
java connection  iam unable to attach the printer to my application application:fee receipt in this iam unable to code the printer to print the receipt
Connection on MsAccess - Java Beginners
Connection on MsAccess  Hi friend.. This is the code .... I have...=getContentPane();setBounds(0,0,800,600); setDefaultCloseOperation(EXIT_ON_CLOSE); img1... Connection getConnection() { Connection con=null; // Loading driver try
Problem with open connection - Hibernate
hibernate application and the database is ORACLE 10g.I am getting the below error.I... open connection... Adapter could not establish the connection
connection database error
connection database error  import java.awt.EventQueue; // import...); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); try...{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection
connection
the connection with the available port on the host machine: import java.net.... the connection was not established. Predict the output of the preceding code. Explain why the connection cannot be established
sql express connection
sql express connection  Sir, I am using ms-SQL server 2005 as database. i have .mdf file and .ldf database base files with me. How to connect to these files in my web application. I am using type-4 drivers... Please let me know
DataBase Connectivity with MySql in Visual Web JSF Application Using Net Beans IDE
. In this application, we are going to create a database connection with mysql step...DataBase Connectivity with MySql in Visual Web JSF Application Using Net Beans...;  This Application illustrates how to create database
android connection to database oracle 10g
android connection to database oracle 10g  Hello, How i can connect my android application to my oracle 10g database
JDBC connection closed.. - Java Beginners
and after that you close the connection, now if you fetch the value from...JDBC connection closed..  if the connections r closed..the values... the connection (jdbc) is closed)   Hello, As i know after
how to solve an internet connection problem
how to solve an internet connection problem  when i run my application it give me this error: Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedOperationException: Not yet implemented the problem is that i don`t know
connection pooling - Java Interview Questions
a predetermined number of Connection objects.A client application would...connection pooling  What is connection pooling?kindly help me in giving this answer. give me one example?  Hi friend, Connection
Use of Connection Pooling - JSP-Servlet
Use of Connection Pooling  Dear Friends i want to use connection... Connection con=null; public static Connection getConnection() { try..."); Connection con=po.getConnection(); } catch(Exception e
Common connection in JSP - JSP-Servlet
Common connection in JSP  Hi I am creating an JSP application. I... connection to database. I am able to get connection in other(common) JSP, but not able to use that "Connection conn" into other JSP pages . How do i access
Application Programmer with Fresher
Application Programmer with Fresher  what difference between http and httpsession? In http session connection is close after giving responce... disable by client) then server create connection to receive request and process
A JDBC Connection Pooling Concept
; } JDBC Connection Pooling JDBC Connection pooling is similar to any other object pooling. Connection pooling is very useful for any application which uses... the connection, this take more time, therefore application becomes slower
Could not establish the connection to oracle - JDBC
Could not establish the connection to oracle  Hi Friends, I am... not establish the connection... to use: Connection conn = DriverManager.getConnection("jdbc:oracle:oci8
Database Connection Pooling (DBCP)
and quicker response using the available connections as making new connection is very... within a giant database application. The database enabled applications needs the database connection for processing the request send by the clients
Swing Application help
Swing Application help  Hi am developing an application. I have set... in the same window. I mean should not close and open another window. also after the last...;Here is a swing application that will insert the form data into database