javaÁ¬½ÓÊý¾Ý¿âÎÊÌ⣬¼±¼± - Java / Java SE
ΪʲôÁ¬½Ó²»³É¹¦ÄØ£¿ÄĸöÄܽâ´ðÏÂ
ÎÒÁ¬½ÓÊý¾Ý¿âsql server 2005
ÏÂÁËjdbcÇý¶¯ÅäÖÃÁ˺ܶà´Î¶¼²»³É¹¦
ÓÐÄĸöÅóÓÑÖªµÀÔõÑùÅäÖÃÂð£¿
Õâ¸öÏÂÃæ´úÂëÁ¬½Ó³öÏÖµÄÎÊÌâ
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at test.main(test.java:12)
Java code:
import java.sql.*;
public class test
{
public static void main(String[] args)
{
Connection con=null;
Statement stmt=null;
ResultSet rs=null;
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con=DriverManager.getConnection("jdbc:sqlserver://localhost:1433;integratedSecurity=true;DatabaseName=JSPTest","sa","java");
stmt = con.createStatement();
rs = stmt.executeQuery("select userName,passWord,email from regist");
while(rs.next())
{
String strUserName = rs.getString(1);
String strPassWord = rs.getString(2);
System.out.println(strUserName+'\t'+strPassWord+'\t');
}
if(rs!=null)
rs.close();
if(stmt!=null)
Ïà¹ØÎÊ´ð£º
ÇëÎÒÓÃFCKÉÏ´«Îļþ,ÔÚ±¾µØµÄwindows»úÉϲâÊÔ¿ÉÒÔ£¬µ«²¿Êðµ½linux·þÎñÆ÷ÉϾÍÉÏ´«²»ÁËÎļþ£¬ÉÏ´«Îļþʱһֱ¿¨ÔÚÄÇÀï¡£Íû¸÷λ´óϺָµã£¬Ð»Ð»£¡
·¹ý£¬°ïÄ㶥һϡ£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£
ÉÏ´«ÎļþµÄ·¾¶ÎÊÌ⣬ ......
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 52 in the jsp file: /vip_info.jsp
ÕË cannot be resolved
49: <table border="1& ......
ÔھƵê¹ÜÀíϵͳÖÐ,ÓÐÒ»¸ö¶ÔÄÚµÄϵͳ,¹©Ç°Ì¨·þÎñÔ±ºÍ¾ÀíʹÓÃ
»¹ÓÐÒ»¸ö¾ÍÊǶÔÍâ,Èÿͻ§¿ÉÒÔÔÚÍøÉÏÔ¤¶©·¿¼ä,
ËüÃÇÖ®¼äÊÇÔõôͨѶµÄ.?µ±ÎÒÌá½»Ô¤¶©·¿¼äÐÅÏ¢µÄʱºò,
ÔÚ¶ÔÄÚµÄϵͳÖÐ,ÈçºÎÖªµÀÎÒÒѾÌá½»ÁËÐÅÏ¢¹ýÈ¥.Ê¹Ç ......
¾ÍÊǼòµ¥µÄ´«ÖµºÍȡֵ
ÇëÎÊÂ¥Ö÷ÏëÎÊʲô£¿
jspÒ³Ãæ²ÉÓÃ±íµ¥»òÕßjavabean´«Öµ¶¼¿ÉÒÔ£¬Ê¹ÓÃrequest.getParameter()»ñµÃʹÓÃ±íµ¥´«¹ýÀ´µÄÖµ¡£
ÎÊÎÊÌ⣬ÏȰÑÎÊÌâ˵Çå³þµã£¡£¡ ÎÊÌâ̫ģºý£¡£¡
ÎÊÎÊÌ⣬ÏȰÑÎ ......
id name datetime
1 a 2010-05-13 10:15:00
2 b 2010-05-14 09:10:00
3 d 2010-05-14 10:10:00
ÈçºÎ½«¾àÀëĿǰ×î½üµÄÄǸö¼Ç¼µÄname ¸üÐÂΪ¡°x¡±ÄØ
лл¿© °¡ ºÇºÇ
update table_n ......