O
ojvm
hi to everybody. tanks in advance for take some of your time to read
this.
ok the cuestion is simple. a class makes a transaction and throw a
exception (SQLException) so, in jsp i make a instance of that class,
because the class throws a exception it must be catch in the jsp.
The problem is when a exception occurs in the class if i catch the
exception in the same class in the jsp i can't see the error, so how
can i make a rollback in the class and still see the error en the
page??
ok this is how it works
---jsp----
try{
MyClass c = new MyClass();
}catch(SQLException e){
out.println("error number..." + e.getErrorCode());
}
--class--
//cn is a valid Connection;
try{
cn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
cn.setAutoCommit(false);
make some code...
cn.commit();
}catch(SQLException e){
//if a error occurs make the rollback()
cn.rollback();
}
with this code the error stays here, in this class.
i hope someone can help me.
this.
ok the cuestion is simple. a class makes a transaction and throw a
exception (SQLException) so, in jsp i make a instance of that class,
because the class throws a exception it must be catch in the jsp.
The problem is when a exception occurs in the class if i catch the
exception in the same class in the jsp i can't see the error, so how
can i make a rollback in the class and still see the error en the
page??
ok this is how it works
---jsp----
try{
MyClass c = new MyClass();
}catch(SQLException e){
out.println("error number..." + e.getErrorCode());
}
--class--
//cn is a valid Connection;
try{
cn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
cn.setAutoCommit(false);
make some code...
cn.commit();
}catch(SQLException e){
//if a error occurs make the rollback()
cn.rollback();
}
with this code the error stays here, in this class.
i hope someone can help me.