只在mysql上测试过,不知道算不算好使
1. [代码][Java]代码
package org.load.demo;
import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.loadphp.simple4j.ContentValues;
import com.loadphp.simple4j.DB;
import com.loadphp.simple4j.Utils;
public class MyServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
String action = req.getParameter("action");
if("show".equalsIgnoreCase(action)) {
this.findAll(req, resp);
}else if("del".equalsIgnoreCase(action)) {
this.del(req, resp);
}else if("edit".equalsIgnoreCase(action)) {
this.find(req, resp);
}else if("update".equalsIgnoreCase(action)) {
this.update(req, resp);
}else if("insert".equalsIgnoreCase(action)) {
this.insert(req, resp);
}
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
this.doGet(req, resp);
}
private void findAll(final HttpServletRequest req, HttpServletResponse resp) {
// DB db = this.getDB();
// List
阅读(512) | 评论(0) | 转发(0) |