Forums Register Login
Problem in using Database Connection for write/read

I have a simple application to write/read data to/from a database.

In my implementation I am using the same Connection in a program run to write as well as read data. I.e once the Connection is open, it is closed only when the program exits.

The problem I am facing is that if I write some data and try to read it in the same session (ie. program execution) I am unable to find the data I inserted recently.

The data is however visible in subsequent runs of the program.

I found from the java docs that Connections are by default auto commit. So I am expecting that search on data inserted in the same program run should return the data.

Any information on how to avoid this problem ?


Please ignore this topic... the problem was in the logic implementation ...

It is working fine now..

permaculture is giving a gift to your future self. After reading this tiny ad:

This thread has been viewed 640 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 21, 2018 03:24:45.