jspÐÂÊÖ,Çë½Ì¸÷λ? - Java / Web ¿ª·¢
³ÌÐòÈçÏÂ:
<%@ page contentType="text/html; charset=GBK" %>
<%@ page language="java" %>
<%@ page import="com.mysql.jdbc.Driver" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>title</title>
</head>
<body>
<%
//Çý¶¯³ÌÐòÃû
String driverName="com.mysql.jdbc.Driver";
//Êý¾Ý¿âÓû§Ãû
String username="root";
//ÃÜÂë
String password="*******";
//Êý¾Ý¿âÃû
String dbName="study";
//±íÃû
String tableName="product";
//Á¬½Ó×Ö·û´®
String url="jdbc:mysql://localhost/"+dbName+"?characterEncoding=GBK";
try{
//¼ÓÔØÇý¶¯³ÌÐò
Class.forName("com.mysql.jdbc.Driver");
//½¨Á¢Í¬Êý¾Ý¿âµÄÁ¬½Ó¶ÔÏó
Connection connection=DriverManager.getConnection(url,username,password);
Statement statement = connection.createStatement();
String sql="SELECT * from "+tableName;
//·¢ËÍÒªÖ´ÐеÄSQLÓï¾ä
ResultSet rs = statement.executeQuery(sql);
out.print("Êý¾Ý¿âÁ¬½Ó³É¹¦<BR>");
while(rs.next())
{
out.print(rs.getint(1));
out.print(rs.getString("pdm"));
out.print(rs.getString("pname
Ïà¹ØÎÊ´ð£º
JSPÒ³ÃæÖÐÓжà¸öradio°´Å¥
JSPÒ³Ã潫²ÎÊýPOST¸øservlet
ÒªÇóÈçÏÂ;
1.Ñ¡ÔñÒ»¸öradio£¬µ÷ÓÃservlet servletÖиù¾Ý²ÎÊýµ÷ÓÃÆäËû½Ó¿Ú£¬³ý·ÇÑ¡ÖиÃradio²¢µã»÷JSPÖеÄʵР......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
ÇëÎʸ÷λ¸ç¸ç½ã½ã£¬ÈçºÎÔËÓÃÏֳɵÄÄ£°åÀ´ÖÆ×÷ƯÁÁµÄJSPÍøҳѽ,»ØÕßÓзÖ!
×Ô¼º¶¥Ï£¬×ÜÓиßÊÖ°É,ÆÚ´ýÖÐ......
Èç¹ûÖ±½ÓÒýÓýøÈ¥
¿ÉÒÔÖ±½ÓÓÃjspµÄÖ¸ÁҲ¿ÉÒÔÓÃfreemarkÒýÓ㬼ǵøø·Ö
лл¸÷λÁË£¬¿´À´Î ......
java swing ³ÌÐòÈçºÎ´ò°ü³Éjar£¬È»ºó¿ÉÒÔͨ¹ýÅú´¦ÀíÎļþbatÖ±½ÓÔËÐУ¬ÓÐûÓÐʲô¹¤¾ßÖ±½Ó¿ÉÒÔÍê³ÉÕâÁ½¸ö¹¤×÷£¿
ÓÃjar´ò°ü£¬°ÑÔËÐÐÐèÒªµÄjar¿½±´µ½Ò»¸öĿ¼£¬Åú´¦ÀíÓà start javaw -cp .;ÆäËû°ü·¾¶ ÔËÐÐ
ÓÃzip ......