I'm getting an weird error while accessing the database from JDBC driver in JSP using JAVA codes.

plz help me to find a sollution the program and error details are below.

<%@ page import="java.sql.*" %>
    Statement st;
    Connection con;
    con = DriverManager.getConnection("jdbc:odbc:DSN");
    st = con.createStatement();
    ResultSet res = st.executeQuery("SELECT * FROM tbNameOne");
        out.println(res.getString(1) + "  " + res.getString(2) +"<br>");
    catch(Exception e)
these codes returns no error while building the project in NetBeans v6.1

running this file returns me a error message, given below
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid string or buffer length
In the ODBC Data Source, i have added the DSN correctly in both the tabs (user DSN and system DSN, in case i was added in the wrong tab, to be on the safe side i added on both of them).

I am Using:
OS: Windows 7 RC
Database: Microsoft SQL Server 2000
IDE: NetBeans v6.1 (Server Apache TomCat)