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]
# 1

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

JavaDen at 2007-6-29 0:52:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
this was on a Win2K machine it might be a little different on a NT machine
JavaDen at 2007-6-29 0:52:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
If I am using the JDBC-ODBC Bridge driver which do I choose to add in the DSN?
dUb at 2007-6-29 0:52:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

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

JavaDen at 2007-6-29 0:52:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
little errorString sqlstatement = "Insert INTO People (Lastname) VALUES (?,?)"; Has to be (LastName,FirstName)
JavaDen at 2007-6-29 0:52:00 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...