column « Database « JSP-Servlet Q&A

1. variable column

I have a database in MS-Access which has field names as "1", "2", "3", ... "10". I want to select column 1 then when I click a button, column 2, column 3, ...

2. java.sql.SQLException: Column count doesn't match value count at row 1 Servlets Error or Mysql Error?

try {
    Statement stmt = con.createStatement();
    stmt.executeUpdate("INSERT into emailacc(fname,lname,uname,mail,passwd,passwd2,date,month,year) values('"+fname+","+lname+","+uname+","+mail+","+passwd+","+passwd2+","+date+","+selectMonth+","+year+"')");
    out.println("<h3><font color='green'>Information Added Successfully.</font><br> You Are a registered User now.</h3><br>");

3. Why does it not print out the database columns???

Why does it not print out the database columns??? I am using a bean to handle database connection, here is the bean code below: package mybeans; import java.sql.*; public class GetDbInfo { ResultSet rs; String PHONE; public GetDbInfo() { try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(Exception e) { System.out.println( "error: connection to " + "sun.jdbc.odbc.JdbcOdbcDriver"); } try{ Connection con = DriverManager.getConnection("jdbc dbc:MyDatabase2"); Statement stmt ...