Hello,
I'm a newbie in struts and have the following problem:
i want to connect to a local DB2 Personal Edition Database. but everytime i get a ClassNotFoundException by running the code in a Model Bean:
import java.sql.*;
public boolean checkLogin(String user, String password)
throws SQLException
{
try
{
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
Connection my_con = DriverManager.getConnection("jdbc:db2:MyDB",
user , password);
return true;
}
catch (ClassNotFoundException e)
{
return false;
}
catch (SQLException se)
{
return false;
}
}
I know that datasourses should be declared in struts-config.xml. but this should not influence this code fragment. I'm very confused, because i use the same (!!!) code in a simple java application. there everything's well...what must i do to run this code under struts and tomcat???must i declare the datasourses in the struts-config.xml???
Thanx!!!
Chikea
I'm a newbie in struts and have the following problem:
i want to connect to a local DB2 Personal Edition Database. but everytime i get a ClassNotFoundException by running the code in a Model Bean:
import java.sql.*;
public boolean checkLogin(String user, String password)
throws SQLException
{
try
{
Class.forName("COM.ibm.db2.jdbc.app.DB2Driver");
Connection my_con = DriverManager.getConnection("jdbc:db2:MyDB",
user , password);
return true;
}
catch (ClassNotFoundException e)
{
return false;
}
catch (SQLException se)
{
return false;
}
}
I know that datasourses should be declared in struts-config.xml. but this should not influence this code fragment. I'm very confused, because i use the same (!!!) code in a simple java application. there everything's well...what must i do to run this code under struts and tomcat???must i declare the datasourses in the struts-config.xml???
Thanx!!!
Chikea