📄 deleteposition.java
字号:
package com.everstar.career;
/**
* Title: webstar
* Description: this is the webstar project
* $ Modified Record:
$2003.4.6: Created.
* Copyright (C) 2003 www.studyjava.com All rights reserved.
* @version 1.0
*/
import java.util.*;
import java.sql.*;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.everstar.database.*;
public class DeletePosition {
private int positionId = 0;
private Database dbConn = null; //database connection
private String error = null;
private String nextURL = null;
public void setPositionId(int newPositionId) { positionId = newPositionId;}
public int getPositionId() { return positionId;}
public Database getDbConn() { return(dbConn); }
public void setDbConn(Database newDbConn) { dbConn = newDbConn; }
public void setError(String newError) { error = newError;}
public String getError() { return error;}
public String getNextURL() { return((nextURL != null) ? nextURL : ""); }
public void setNextURL(String nextURL_) { nextURL = nextURL_; }
public void init() throws ServletException {
if (dbConn == null) error = "No Database Connection";
if (positionId <= 0) error = "No Position Id";
try{
String sql = "delete from position where positionId =" + positionId;
dbConn.delete(sql);
sql = "delete from resume where positionId =" + positionId;
dbConn.delete(sql);
dbConn.select(sql);
//request.getRequestDispatcher(response.encodeURL(getNextURL())).forward(request, response);
}catch(Exception e) {
error = "SQL Error!";
}
}
public DeletePosition() {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -