• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Caching problem

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

i have this JSP where i'm getting rows of data displayed from the database. Some of the feilds in the row are editable and on one click of a submit button all the rows that are changed should be updated.
All this works fine but SOMETIMES, the database gets updated wiht previous value...
i don;t know whether the connection is using cached resources.... but i don't want that... how can i avoid this...!!???
Is there any feature for setting the connection string to "set cache false".
Im using jdbc:mysql connection string.

My connection string is as below
---------------------------------
Connection conn=DriverManager.getConnection("jdbc:mysql://222.1.2.3:3306/itsupport","net","123");


I have already used:
--------------------
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);

but this doesnot work... coz the problem is not in the display of the data but my problem is that my connection uses cached resources...
How can i avoid it.. please help...
 
Rekha Pande
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried searching through google as to how the above is possible... the only way how i can see is to use oracle connection.

i have downloaded the oracle-jdbc.jar and the ojdbc14.jar file..and attached to my class path.

But when i execute the following lines of code ..


I get the following error :
ERROR
------
java.lang.ClassCastException
java.lang.ClassCastException


Please if this is not the appropraite forum .. can one of the bartenders move this question to that forum where i can get the solution... coz it is a bit important..!

Thanxs...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64619
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to JDBC.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Your connection URL uses mysql (not oracle): jdbc:mysql

Then you try to cast the connection to an oracle one and it isn't one.
 
Rekha Pande
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Carol Enderlin you were right... when i did it with an jdbc racle..it worked fine...

Does any one have any idea how i can get the cache size of a connection when im using jdbc:mysql in the DriverManager....???

Thanxs
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should go for MySql Documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic