• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Problem in using Database Connection for write/read  RSS feed

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 ?

Thanks,

Vinayak
 
Vinayak patil
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore this topic... the problem was in the logic implementation ...

It is working fine now..

-Vinayak
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!