How to check if a web page is synchronized on a local server in JSP ?
I have tried to make database updation synchronized in jsp but how can i check it on local web server (
tomcat) ?
I have used Oracle database.
I am kinda new with JSP so explain in little detail.
Thank you
More Info:
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","username","password");
balance=balance-1500;
String query1= "update bank set bal=? where card_no='"+cnumber+"'";
PreparedStatement st1 = con.prepareStatement(query1);
st1.setString(1,String.valueOf(balance));
int qresult1 = st1.executeUpdate();
This is some of the code in which I have not applied any synchronization.
In simple words, I want to know how to
test if synchronization part is really working or not ?
My main motive is... I am trying to make an admission form and I want a limited number of seats but I want after every registration process my database updates the seat numbers accordingly and show the right information about how many seats are left to the user. (though in the given code i am just changing the balance)
If is there any other way please help me ?
Like in this example
<%!
PreparedStatement pst = con.prepareStatement("query");
%>
synchronization
<%
synchronized(pst)
{
pst.setXXX(...);
pst.setXXX(...);
pst.executeXXX(...);
}
%>