0 Replies - 299 Views - Last Post: 07 September 2010 - 09:27 AM Rate Topic: -----

#1 Gh0st34  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 26
  • Joined: 29-July 09

Acces database problem

Posted 07 September 2010 - 09:27 AM

i cant save a new data on my database i dont know what is the problem here is my code written in neatbeans

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Save</title>
    </head>
    <body>
    
   <%
            Connection conn;
            ResultSet rs;
            Statement stmt;
            String myUsername = request.getParameter("txtuser");
            String myPassword = request.getParameter("txtpass");
            
            try{
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                conn = DriverManager.getConnection("jdbc:odbc:db1");
                stmt = conn.createStatement();
                stmt.executeUpdate("insert into Account(UserName, Password)values('" + myUsername + "', '" + myPassword + "')");
            } catch (Exception e){
                out.print(e.getMessage());
            }
     %>
    
    </body>
</html>



Is This A Good Question/Topic? 0
  • +

Page 1 of 1