Link to home
Start Free TrialLog in
Avatar of sunnystar
sunnystarFlag for Afghanistan

asked on

How do I update a TIMESTAMP column of a MYSQL table with the current date and time in Java

I am trying to update a TIMESTAMP column of a MYSQL table with the current date and time in Java code.

String sqlString = "SELECT * FROM table WHERE ..." ;
        Statement st = con.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,
                ResultSet.CONCUR_UPDATABLE ) ;
        ResultSet rs = st.executeQuery(sqlString) ;
        rs.first();
        rs.updateInt("status", STATUS_OPTED_OUT) ;
???---what would go here for a column "update_time" ?
        rs.updateRow();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of stevengmoreau
stevengmoreau

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial