[color=#FF0000][/color]ÒÔÏÂÊÇÎÒµÄservlet´úÂë[color=#FF0000][/color]package JDBCExample1.demo1;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
public class JDBCExample1 extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
request.setCharacterEncoding("GBK");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
String usename,password;
usename=request.getParameter("usename");
password=request.getParameter("password");
String url="jdbc:oracle:thin:@192.168.1.233:1521:XE";
String sqlname="admin";
String sqlpassword="admin";
String sql="insert into guestbook(id,name,password) values(gb_seq.nextval,?,?)";
int result=0;