Code example for PreparedStatement

Methods: executeUpdate, setInt, setString

0
//                    dropDatabaseUser(rssInstance, user.getUsername(), tenantId); 
//                } 
//            } 
            String sql = "DELETE FROM RM_SERVER_INSTANCE WHERE NAME = ? AND TENANT_ID = ? AND ENVIRONMENT_ID = (SELECT ID FROM RM_ENVIRONMENT WHERE NAME = ?)";
            stmt = conn.prepareStatement(sql);
            stmt.setString(1, name);
            stmt.setInt(2, tenantId);
            stmt.setString(3, environmentName);
            stmt.executeUpdate();
        } catch (SQLException e) {
            throw new RSSDAOException( 
                    "Error occurred while dropping the RSS instance '" 
                            + name + "' : " + e.getMessage(), e);
        } finally { 
            RSSDAOUtil.cleanupResources(null, stmt, conn);
        } 
    } 
 
 
    public void updateRSSInstance(String environmentName, RSSInstance rssInstance,
                                  int tenantId) throws RSSDAOException {