DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13792>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13792

NullPointerException using JDBC

           Summary: NullPointerException using JDBC
           Product: Struts
           Version: 1.1 Beta 2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Example
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Using the "struts-example" as a base to learn & build new app.  Started adding 
database access.  Put following code into "logonAction.java", 
method "ActionForward execute(...", :
        // Validate the request parameters specified by the user
        ActionErrors errors = new ActionErrors();
        String username = (String)
            PropertyUtils.getSimpleProperty(form, "username");
        String password = (String)
            PropertyUtils.getSimpleProperty(form, "password");

// New stuff

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    
        Connection conn = DriverManager.getConnection
("jdbc:odbc:BIPSDB", "BIPSLogon", "bi4agt");
        
    try {
    //    stmt = conn.prepareStatement("SELECT * FROM Users WHERE UserID 
>= ? ");
        //      stmt.setString(1,userIDKey);

    //    rs = stmt.executeQuery();
                Statement stmt2 = conn.createStatement
(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);

                ResultSet rs = stmt2.executeQuery("SELECT * from Users");
                String anything = "Bogus";

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to