mysqlÁ¬½Ótomcat - Java / Web ¿ª·¢
ÎÒÒѾ°´Õս̳ÌÉÏÅäÖÃtomcatµÄserver.xml
<Context path = "/POS" docBase = "POS" debug = "5" reloadable = "true" crossContext = "true" workDir = "">
<Resource name = "jdbc/pos" auth = "Container" type = "javax.sql.DataSource" maxActive = "100" maxIdle ="30" maxWait = "10000"
username = "root" password = "rarzyz" driverClassName = "org.gjt.mm.mysql.Driver" url = "jdbc:mysql:// localhost/test"/>
</Context>
Ò²°Ñ½Ì³Ì¹âÅÌÉϵÄweb.xmlºÍappcontext.xml¶¼¸´ÖÆÈ¥ÁË¡£µ«ÊÇ»¹ÊÇÔÚ°´Ìá½»µÇ½µÄÓû§ÃûºÍÃÜÂëÒ³Ãæºó£¬ÏÔʾhttp status 500 The server encountered an internal error () that prevented it from fulfilling this request.
org.hibernate.exception.GenericJDBCException: Cannot open connection
Õâ¸ö²»ÄÜ´ò¿ªÁ¬½ÓÌáʾ£¬ÊDz»ÊÇÌáʾÎҵijö´íÁ˰¡¡£ÎÒ¿´¹ýtomcatºÍmysql·þÎñÎÒ¶¼¿ªÁË¡£ÓôÃÆ°¡¡£Çý¶¯ÎÒÒ²¿¼µ½libÀïÃæÁË¡£ÊµÔÚ²»ÖªµÀ´íÎóÔÚÄÄÀïÁË
Ã²ËÆÕâÁ½¸ö¶¼ÓÐÎÊÌ⣺
driverClassName = "org.gjt.mm.mysql.Driver" url = "jdbc:mysql:// localhost/test"/>
Çý¶¯Ãû²»¶Ô£¬urlÉÙÁ˶˿ں𣡣¡£
public static String driver="com.mysql.jdbc.Driver"
public static String url="jdbc:mysql://localhost/mydata?user=Óû§Ãû&password=ÃÜÂë"
¿ÉÒÔ²»Òª¶Ë¿ÚºÅ
Ïà¹ØÎÊ´ð£º
ÎÊÌâÃèÊö£ºÐ´ÈÕÖ¾¹¦ÄÜ£¬Ð´ºÃµÄдÈÕÖ¾·þÎñ£¬ÆäËûÓû§Í¨¹ýhttpµ÷Ó÷þÎñ£¬´«Èë²ÎÊý£¬È»ºó¼Ç¼ÈÕÖ¾£¬
ÎҵķþÎñ¸ÃÔõôд£¬ ±ðÈËÔõôͨ¹ýhttpµ÷ÓÃÎҵķþÎñ£¬ÎÒÓÃwebserviceдºÃÁËÒ»¸ö£¬¿ÉÊDz¢·¢ÓÐÉÏÏߣ¬Ïë¸ÄÓ ......
ÎÒÏÖÔÚÓÃstruts2¿ò¼Ü,ÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔǰservletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõôР......
ÎÊÌâÊÇÕâÑùµÄ£º
ÎÒÓÐÒ»¸öÎļþnagiv.jsp ÁíÒ»¸öÎļþfailure.jsp°üº¬Ëû£¬Í¬Ê±nagivÎļþÖÐÓÐÒ»¸ö¿ÉÒÔÌø×ªµ½yy.jspµÄcommandButton£¬µ«ÊÇÎÒ½«failureÖеã»÷nagivÖеÄÄĸöcommandButton£¬Ò²Ãæ²»»áÌø×ª ......
<html><head><title>[@title]</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<script language='javascript'>
function diyCheck ......
ÎÒ¶¨ÒåÁËÒ»¸öJRadioButtonNanµÄµ¥Ñ¡°´Å¥£¬Èç¹ûÔÚÎÒÑ¡ÔñÁËÕâ¸ö°´Å¥ºóÏëµã»÷ÖØÖÃÈÃÕâ¸ö°´Å¥´¦ÓÚδѡÔñµÄ״̬¸ÃÔõô×öÄØ£¿Çë¸ßÊÖÖ¸½Ì
jRadioButton.setSelected(false);
²»ÖªµÀÄãÊÇʲôÒâ˼
Õâ¸öÊDz»Ñ¡Ôñ״̬ÁË
Î ......