This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I first tried that, did not get any help so I am posting in forums ,they say about a stateful connection but donot say what makes a jdbc connection stateful ,we have an very old project and guys there say they create a stateful database connection , when I aksed them what is the diference between stateful and stateless database connection they did not have any answers , and more over they are not good at programming so I cannot expect answers from them and would like to know what they mean , please help me understand if you know the difference ?
In a stateful connection, you rely on the fact that you will keep on using the same database connection (session) during the run of your application.
Such programs typically use database session variables or temporary tables.
They might set a variable in database action a: (example: user selects country "china", program stores this country in an environment variable).
They can use that variable later on in action b: (example: they have built some views that will restrict data based on that variable, without the need for your program to filter yourself: you can do "select city from world_cities_view" , but the database would only return Chinese cities ).
A stateless connection does not rely on any activity that has occurred in the past. It does not remember anything.
You should treat Connection Pool connections as stateless.
You can use dedicated connections as stateful. The database can remember things for you.