ODBC Datasource
When I try to run my JSP page I get the following error.
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I think that I need to create and ODBC Datasource however I do not know how to do this. I am running on an NT machine. I know that in the control panel their is a place to set up ODBC data sources however I do not know what to do when I open this up. Any help is appreciated.
[546 byte] By [
dUb] at [2007-9-26 1:19:28]

Click on System dns then on add
a list of drivers will be displayed take the one you need
then a new dialogbox will be displayed in the Data sorce Name field type in the name that you want to use click on the Select statement to browse to the database click on ok after you are done. That's it (for access) for SQL server you have to select the servername and the database
this is something I used
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:JspTest";
String user = "";
String password = "";
String sqlstatement = "Insert INTO People (Lastname) VALUES (?,?)";
try{
Connection con = DriverManager.getConnection(url, user, password);
Class.forName(driver);
PreparedStatement pstmt = con.prepareStatement(sqlstatement);
pstmt.setString(1,message);
pstmt.setString(2,message);
pstmt.executeUpdate();
if(pstmt != null) pstmt.close();
if(con != null) con.close();
}// end try
JspTest is the name of my ODBC Datasource