This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Regarding the Connection interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Regarding the Connection interface" Watch "Regarding the Connection interface" New topic
Author

Regarding the Connection interface

nandy desikan
Greenhorn

Joined: Apr 02, 2007
Posts: 10
Hi ,

I have been a java developer for long and yet there is one question that struck my mind today.
The java.sql.Connection is an interface. Agreed. There is a method named commit() which explicitly commits all transactions made(considering autocommit is false).
This commit() in the connection interface does not implement anything, I am very curious to know what happens when this commit() is called.

There is something called System Global Area(SGA) which is a shared random access memory (RAM) allocated by oracle to manage connection pooling, caching ,etc.
So, when we call the commit method of the connection interface, does any thing happen in the java pool in the sga I mentioned above.

This question may be trivial to many experts, but I am found searching for an answer. If anyone finding time , can you please answer this.

Regards,
nandydesikan
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

Connection is an interface,
but the class you get from your JDBC jars when you get a connection is (has the type of) a concrete Java class.
And you call the commit() method of that concrete Java class.




and then I have to admit that I know nothing whatsoever of the SGA


OCUP UML fundamental and ITIL foundation
youtube channel
nandy desikan
Greenhorn

Joined: Apr 02, 2007
Posts: 10
Thanks a lot for clarifying!!
so an object reference of type Connection interface will be type cast over the implementation class (Oracle connection)_plain old java principle
Cool!! Thanks. This was digging my mind since Friday ...

Cheers,

Prashanth Mohan
Greenhorn

Joined: Apr 10, 2010
Posts: 1
This is a very helpful thread..Came to know a very Important point from this..Thanks Guys..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Regarding the Connection interface
 
Similar Threads
Some CMT and BMT doubts in EJB?
JDBC Transaction beginning
Locking Oracle Record
Auto commit???
query on setAutoCommit()