Dear all,
I am using JBuilder 6 to run my servlet and application. I use my servlet to listen on
port 80, and use the application to send a MIME message to the servlet. After sending
out the message, the application updates a database, adding the message number in it.
I am using JDBC_ODBC bridge, access database.
The relating program is:
try{ con = connMgr.getConnection();
if(con != null)
System.out.println(con.toString());
stmt = con.createStatement ();
if(stmt != null)
System.out.println(stmt.toString());
int result = stmt.executeUpdate(query);
con.commit();
System.out.println(result);
return result;
}
catch(SQLException ex)
{
throw new SQLException(ex.getMessage());
}
finally{
try{
stmt.close();
connMgr.releaseConnection (con);
System.out.println("finally");
}
catch (SQLException se)
{
se.printStackTrace();
}
}
I found that running the application in JBuilder can't update the database, although
it gives no errors. Running the application in command line also can not work.The
output is like this:
sun.jdbc.odbc.JdbcOdbcConnection@4247a0
sun.jdbc.odbc.JdbcOdbcStatement@6c6696
1
finally
You see the value of 'result' is 1, and this is right. But the database was not
updated. It's very strange that everything was fine when I use Jbuilder to debug it:
the database was updated properly, and the output was the same as before.
So I got confused: what's wrong in my program? Why debugging can work but running can
not? What's the difference with them?
Can anyone help me? I'm really anxious. Thanks a lot!
Ying
�{.n�+���j)m�X��ǫ�6�j˧r����[�ܬ� �}�R<�SLZ+v(�ٚ�[h�+-��ڲ�ܢl"��w+���
��DD�
��I4���ޕ�ڞ�@B�'%#�I���lq��y�.�֭��i���r�z�ڽ�.��&�;)�{^��-�٥��i��ڽ�.��&���v�-����ڪf�m�������ڞ�(�
��;)�;)}����m����#���r��}���w^�;)��i��0�;)�{"u�ܢ