´î½¨JSP ×éºÏMyEclipse£«MySQL£«Tomcat¿ª·¢»·¾³
Ò»¡¢°²×°JDK ¡¡¡¡Ê×ÏÈÏÂÔØJDK 5.0£¨JDK 5.0µÄÏÂÔØÒ³ÃæΪ£ºhttp://java.sun.com/j2se/1.5.0/download.jsp£©£» È»ºóÔËÐÐJDK 5.0°²×°³ÌÐòjdk-1_5_0_06-windows-i586-p.exe£¬°²×°¹ý³ÌÖÐËùÓÐÑ¡Ïî±£³ÖĬÈÏ£»×îºóÅäÖÃJDKµÄ»·¾³±äÁ¿£ºÔÚ“ÎҵĵçÄÔ”ÉϵãÓÒ¼ü—>“ÊôÐÔ”—>“¸ß¼¶”—> “»·¾³±äÁ¿(N)”¡£ ¡¡¡¡Ð½¨ÏµÍ³±äÁ¿JAVA_HOME£ºC:\Program Files\Java\jdk1.5.0_06£» ¡¡¡¡Ð½¨ÏµÍ³±äÁ¿CLASSPATH£º.;%JAVA_HOME%\lib;£¨×¢Ò⣺µãºÅ±íʾµ±Ç°Ä¿Â¼£¬²»ÄÜÊ¡ÂÔ£© ¡¡¡¡ÔÚϵͳ±äÁ¿PathµÄÖµµÄÇ°Ãæ¼ÓÈëÒÔÏÂÄÚÈÝ£º%JAVA_HOME%\bin;(×¢Òâ:ÕâÀïµÄ·ÖºÅ²»ÄÜÊ¡ÂÔ) ¡¡¡¡µ½ÕâÀJDK°²×°Íê±Ï¡£ ¡¡¡¡ÏÂÃæÎÒÃDzâÊÔÒ»ÏÂJDKÊÇ·ñ°²×°³É¹¦£º ¡¡¡¡½«ÒÔÏÂÄÚÈݸ´ÖƵ½¼Çʱ¾ÖУº public class HelloJAVA { public static void main(String srg[]) { System.out.println("Hello JAVA!"); } } ¡¡¡¡Áí´æΪ“HelloJAVA.java”£¨²»º¬ÒýºÅ£¬ÏÂͬ£©£¬²¢±£´æµ½DÅ̸ùĿ¼Ï¡£ ¡¡¡¡ÔÚÃüÁîÐÐÒÀ´ÎÊäÈëÏÂͼÖкìÏßËù±ê×¢µÄÃüÁ ¡¡¡¡Èç¹û³öÏÖÉÏͼºì¿òÖÐËù±ê×¢µÄÄÚÈÝ£¬Ôò˵Ã÷JDK°²×°³É¹¦£¡ ¡¡¡¡×¢Òâ:Èç¹ûÒÔºóÒª°²×°ÖîÈçEclipse¡¢Borland JBuilder¡¢JCreator¡¢IntelliJ IDEAµÈ¼¯³É¿ª·¢»·¾³(IDE,Integrated Development Environment),Ó¦¸ÃÔÚIDEÖбàÒëÔËÐÐÒ»¸ö¼òµ¥µÄHelloWorld³ÌÐò£¬ÒÔ±£Ö¤IDE¿ÉÒÔʶ±ð³öJDKµÄλÖᣠ¡¡¡¡¶þ¡¢°²×°Tomcat ¡¡¡¡Ê×ÏÈÏÂÔØjakarta-tomcat-5.0.30.zip£¬Ö®ËùÒÔÏÂÔØÃâ°²×°°æµÄºÃ´¦ÊÇ¿ÉÒÔʹÓöà¸öTomcat£¨jakarta-tomcat-5.0.30.zipµÄÏÂÔØÒ³ÃæΪ£º http://apache.linuxforum.net/tomcat/tomcat-5/v5.0.30/bin/£©£» ¡¡¡¡È»ºó½«jakarta-tomcat-5.0.30.zipÖ±½Ó½âѹµ½DÅ̸ùĿ¼£º ¡¡¡¡×îºóÅäÖÃTomcatµÄ»·¾³±äÁ¿£ºÔÚ“ÎҵĵçÄÔ”ÉϵãÓÒ¼ü—>“ÊôÐÔ”—>“¸ß¼¶”—> “»·¾³±äÁ¿(N)”¡£ ¡¡¡¡Ð½¨ÏµÍ³±äÁ¿CATALINA_HOME£ºD:\jakarta-tomcat-5.0.30 ¡¡¡¡ÔÚϵͳ±äÁ¿CLASSPATHµÄÖµµÄºóÃæ¼ÓÈ룺%CATALINA_HOME%\common\lib; ¡¡¡¡ÔÚϵͳ±äÁ¿PathµÄÖµÖÐ"%JAVA_HOME%\bin;"µÄºóÃæ¼ÓÈëÒÔÏÂÄÚÈÝ£º%CATALINA_HOME%\bin; ¡¡¡¡µ½ÕâÀTomcat°²×°Íê±Ï¡£ ¡¡¡¡½øÐÐÍêÒ»¡¢¶þÁ½²½µÄÉèÖÃÒԺ󣬸÷ϵͳ±äÁ¿µÄÖµÈçÏ£º JAVA_HOME:C:\Program Files\Java\jdk1.5.0_06 CATALINA_HOME:D:\jakarta-tomcat-5.0.30 CLASSPATH:.;%JAVA_HOME%\lib;%CATALINA_HOME%\common
Ïà¹ØÎĵµ£º
×î½üÒ»Ö±ÔÚÑо¿freeBSDÏÂnginx+php+mysqlµÄ°²×°£¬¿´Á˺ܶàÍøÉϵÄ×ÊÁÏÊÕ»ñ²»Ð¡£¬²»¹ý´ó²¿·Ö¶¼ÊDZàÒë°²×°£¬Ïà¶Ô³õѧÕßÀ´Ëµ±È½Ï¸´ÔÓ£¬²»ÈÝÒ×Àí½â£¬ËùÒÔÎÒÕûºÏÁËһЩports°²×°µÄ×ÊÁÏ£¬¶¼ÊǾ¹ý×Ô¼ºÑéÖ¤ºóµÄ£¬°²×°³É¹¦Ò²±È½ÏÈÝÒ×Àí½â£¬ÏÂÃæÊÇÁ½Öֳɹ¦µÄ°¸Àý£¬ÆäÖÐÓÐÒ»¸öÊÇApache´úÌænginxµÄ°²×°£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
° ......
JSPÖпÉÄÜ»áÅöµ½µÄÎÊÌâ½â´ð
À´Ô´:²»Ïê ×÷Õß:ØýÃû ¸üÐÂʱ¼ä: 2009Äê07ÔÂ02ÈÕ µã»÷:
JSPÖпÉÄÜ»áÅöµ½µÄÎÊÌâ½â´ð
1¡¢ÈçºÎ»ìºÏʹÓÃJspºÍSSI #include?
ÔÚJSPÖпÉÒÔʹÓÃÈçÏ·½Ê½°üº¬´¿HTML£º
< !--#include file="data.inc"-- >
µ«ÊÇÈç¹ûdata.incÖаüº¬JSP CODE £¬ÎÒÃÇ¿ÉÒÔʹÓãº
< %@include file= ......
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index</title>
<meta http-equiv="pragma" content="no-cache"&g ......
package com.wxpn.tutorial.db;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.Date;
/**
* ÃèÊö: Êý¾Ý¿âÁ¬½Ó³ØÀà
*
*
&n ......
°²×°JDBCÇý¶¯£º
½âѹËõmysql-connector-java-3.1.10.zip
½«ÒªÊ¹ÓõÄÊÇmysql-connector-java-3.1.10-bin-g.jarºÍmysql-connector-java-3.1.10-bin.jar
ÅäÖÃ
ÔÚC:\Program Files\JavaĿ¼Ï½¨Á¢mysqlforjdbc×ÓĿ¼£¬½øÈë¸ÃĿ¼½«mysql-connector-java-3.1.10-bin.jarµ½¸ÃĿ¼ÏÂ
½øÈëC:\Program Files\Java\jdk1.5.0_04\l ......