jsp·ÃÎÊMySQLÊý¾Ý¿â´íÎó
²»ÖªµÀÊDz»ÊÇÇý¶¯¼ÓÔØÓÐÎÊÌ⣬ÔÚMyEclipseÖÐдÁ˼òµ¥µÄÊý¾Ý¿â²âÊÔ³ÌÐòÕÒ²»µ½Çý¶¯À࣬ϣÍû´óϺÄܸøÓè°ïÖú£¬Ð»ÁË¡£
ÑÏÖØ: Servlet.service() for servlet jsp threw exception
java.lang.ClassNotFoundException: org.aspectj.lang.Signature
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Proto
Ïà¹ØÎĵµ£º
1.ÓÅ»¯ÄãµÄMySQL²éѯ»º´æ
ÔÚMySQL·þÎñÆ÷ÉϽøÐвéѯ£¬¿ÉÒÔÆôÓøßËÙ²éѯ»º´æ¡£ÈÃÊý¾Ý¿âÒýÇæÔÚºǫ́ÇÄÇĵĴ¦ÀíÊÇÌá¸ßÐÔÄܵÄ×îÓÐЧ·½·¨Ö®Ò»¡£µ±Í¬Ò»¸ö²éѯ±»Ö´Ðжà´Îʱ£¬Èç¹û½á¹ûÊÇ´Ó»º´æÖÐÌáÈ¡£¬ÄÇÊÇÏ൱¿ìµÄ¡£
µ«Ö÷ÒªµÄÎÊÌâÊÇ£¬ËüÊÇÄÇôÈÝÒ×±»Òþ²ØÆðÀ´ÒÔÖÁÓÚÎÒÃÇ´ó¶àÊý³ÌÐòÔ±»áºöÂÔËü¡£ÔÚÓÐЩ´¦ÀíÈÎÎñÖУ¬ÎÒÃÇʵ¼ÊÉÏÊÇ¿ÉÒÔ×è ......
Ò»Ö±ÒÔÀ´ÎÒµÄÎÄÕ¶¼ÊÇÒÔ¹¤×÷±Ê¼ÇµÄÐÎʽ´æÔÚ¡£Õâ¶ÔÓÚ×Ô¼º¶ÁÆðÀ´Ã»Ê²Ã´´ó°£¬µ«ÊǶÔÓÚÆäËû¶ÁÕß¿ÉÄܾÍÓÐЩÃÔã¡£ÎÒ¾¡Á¿¸Ä¸Ä£¬»»ÖÖ·½Ê½¡£
1. MySQL µÄ°æ±¾
Èç¹ûÒªÖ§³Ö·ÖÇø±í£¬ÔòÓ¦¸ÃʹÓà 5.1.x ÒÔÉϵİ汾¡£Èç
mysql> show variables like '%version%';
+-------------------------+------------------------------ ......
tomcat °²×°Ä¿Â¼ÏµÄconfĿ¼ÖеÄcontext.xmlÓëweb.xmlÎļþ·Ö±ðÐÞ¸ÄÈçÏ£º
context.xml мÓÈçÏÂÄÚÈÝ£º
<Resource name="jdbc/mysql"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://Êý¾Ý¿âµØÖ·:3306/Êý¾Ý¿âà ......
ÏÈ´´½¨Ò»¸öÊý¾Ý¿âMyDB
CREATE DATABASE `mydb` ;
ÔÙ´´½¨Ò»¸ö¼òµ¥µÄÊý¾Ý±í
CREATE TABLE `MyDB`.`MyTable` (
`Name` VARCHAR( 20 ) NOT NULL ,
`Age` INT NOT NULL
) ENGINE = MYISAM
²åÈëһЩÊý¾Ý
INSERT INTO `mydb`.`mytable` (
`Name` ,
`Age`
)
VALUES (
'Jim', '15'
), (
'Amy', '16'
), (
'Jack' ......