⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 11-10.txt

📁 jsp常用实例讲解
💻 TXT
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title> 留 言 入 库</title>
</head>

<body bgcolor="#99CCFF">
<hr><center>
<%@ page import="java.sql.*" %>
<%-- 连接数据库使用的语句 --%>
<%
String url=new String();
String sql=new String();
url="jdbc:odbc:liuyan";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn=DriverManager.getConnection(url);
%>
<%
Statement stat=conn.createStatement();
String errorcode="";
String name=request.getParameter("name");
String emote=request.getParameter("emote");
String content=request.getParameter("content");
try{
	String strSql="insert into db2admin.guestbook(name,emote,content) values('"+name+"','"+emote+"','"+content+"')";
	stat.executeUpdate(strSql);
	out.println("<BR><font size=\"+2\" color=\"red\">祝贺,留言成功!</font>");
}catch(Exception e){
	errorcode=e.toString();
	out.println("<BR>DEBUG:"+errorcode);
}finally{
	stat.close();
	conn.close();
}
%>
</center>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -