Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JDBC close a Connection application
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Clark
close a Connection application
1 Answer(s)      4 years and 2 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?


Advertisement
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 Tutorials/Questions & Answers:
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
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
Advertisements
how to close JSF application..?
how to close JSF application..?  how to close jsf appliaction using command button with help of java code
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
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
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
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.
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
Connection
Connection  What is Connection
connection
connection   how to make multiple database connection using jdbc
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
Close Cursors in SQL
Close Cursors in SQL       Close Cursors is used to close the Cursor temporary, when the open cursor is not required. The keyword close in cursor release the current records
why cant i close this ??
why cant i close this ??  import java.util.Scanner; public class square { public static void main ( String [] args) { Scanner keyboard = new Scanner (System.in); int N; N = keyboard.nextInt
Close Cursors in SQL
Close Cursors in SQL       Close Cursors is used to close the Cursor temporary, when the open cursor is not required. The keyword close in cursor release the current records
Close Cursors in SQL
Close Cursors in SQL       Close Cursor is used to close the cursor temporary when it is not required. A cursor in a SQL can be closed with close
To put a "close window" link on a page?
To put a "close window" link on a page?  To put a "close window" link on a page
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
Java file close
Java file close This section demonstrates you the use of close() method.... You can done this using the method close(). This method automatically flush out the stream. It is necessary to close the stream after performing any file
what is the use of Hibernate Sessionfactory close() method?
what is the use of Hibernate Sessionfactory close() method?  hi, What is the use of of Hibernate Sessionfactory close() method? Thanks..   Hello, Close() method of Hibernate Sessionfactory destroys the SessionFactory
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
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
Hibernate session close
In this section, you will learn about session life cycle - from start to end(session close
JFrame Close On Button Click
JFrame Close On Button Click In this section we will discuss about how to close frame on click on the button. This example explains you how a frame can be closed on an action event i.e. a frame should be close when clicked
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 pooling
Connection pooling  What is Connection pooling
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
how can i close a frame. - Java Beginners
how can i close a frame.  Hi, My question is how can we close a frame when an action is taken......For example let us think that we have a frame and in that table is displayed and one button is added to that frame
connection closing
connection closing  hello, what happens if connection is not closed
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
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
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
Advertisements
 

 

 

DMCA.com