Here you can find the source of ClosePhase(long phaseId, Connection con)
Parameter | Description |
---|---|
phaseId | phase id to update. |
con | connection to use. |
Parameter | Description |
---|---|
Exception | if any error occurred. |
static void ClosePhase(long phaseId, Connection con) throws Exception
//package com.java2s; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; public class Main { /**/*from w ww . ja v a2 s . c o m*/ * This method set status to close of specified phase. * * @param phaseId phase id to update. * * @param con connection to use. * * @throws Exception if any error occurred. */ static void ClosePhase(long phaseId, Connection con) throws Exception { executeStatement(con, "UPDATE project_phase SET phase_status_id = 3 WHERE project_phase_id = " + phaseId); } /** * Insert data into the database. * * @param con the connection instance * @param sql the sql to be executed * * @throws SQLException if any sql error */ static void executeStatement(Connection con, String sql) throws SQLException { PreparedStatement ps = con.prepareStatement(sql); ps.executeUpdate(); } }