Code example for Statement

Methods: close, executeUpdate

0
		int updateRecord = 0;
		Statement pstmt = null;
		try { 
			String sql=" update s_org  t set  t.locate=substr(t.locate,0,4)||'"+organno+"'||substr(t.locate,4) where t.organlevel>1 and organno<>'"+organno+"' ";
			pstmt = connection.createStatement();
			updateRecord = pstmt.executeUpdate(sql);		
			 
		} catch (SQLException e) {
			e.printStackTrace();
		} finally { 
			try { 
				if(pstmt != null) {
					pstmt.close();
					pstmt = null;
				} 
			} catch (SQLException e) {
				e.printStackTrace();
			} 
		} 
		 
		return updateRecord;