在JSP中是不是又傳遞了其它的password或者是不是傳遞空的值?????
在一個JavaBeans中定義:
---------------------------MyConnection----------------------------------
import java.sql.*;
import sun.jdbc.odbc.*;
public MyConnection{
public static Connection getConnection(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:dsn_name","sa","pwd");
System.out.println("successfully");
}
catch (SQLException sqle){
System.out.println("error occurs,connect to database fail\n");
System.out.println(sqle.getMessage());
}
catch(ClassNotFoundException cle){
System.out.println("ClassNotFoundException error occurs");
cle.printStackTrace(System.out);
}
return conn;
}
}
//以上以java classname有形式成功執行
--------------------------------------------------------------
但當我在JSP中invoke時,出現error msg: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'sa'.
------ 語句如下---
//在這里我調用MyConnection的method, 但不傳遞任何password 的信息.
Connection myconn=MyConnection.getConnection();
out.print("connected successfully");
--------------
不知道是不是因為在jsp中又傳遞了其它的password 值或者是不是傳遞空的值??請賜教!
Thanks in advance!