jsp login page with jdbc connectivity to ms-access database

i hav been trying to solve the error..but couldnot

<%@ page import="javax.servlet.*" %>

<%@ page import="javax.servlet.http.*" %>

<%@ page import="java.sql.*" %>

<%@ page import="java.util.*" %>

<%@page language="java"%>

<%@page import="java.sql.*"%>

<%

String user = "";

String pwd ="";

Connection con = null;

Statement st = null;

try{

user = request.getParameter("un");

pwd = request.getParameter("pwd");

} catch(Exception e){

}

if(!user.equals("") && !pwd.equals("")){

try

{

Class.forName("Sun.jdbc.odbc.JdbcOdbcDriver");

con = DriverManager.getConnection("jdbc:odbc:nine","admin","");

st = st.executeupdate("Insert into Table9 values (' "+user+" ',' "+pwd+" ' )");

}

catch(Exception e){

e.printStackTrace();

} finally{

try{

if(st != null)

st.close();

if(con != null && con.isClosed() == false)

con.close();

}catch(SQLException sqe){

sqe.printStackTrace();

}

}

}

%>

[1187 byte] By [mnda] at [2007-11-27 2:27:20]
# 1
I left my psychic powers on the bus. what error?+ scriptlets are hideous+ you don't need to import entire packages+ JSPs shouldn't really contain any database code at all
georgemca at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 2
SORRY SIR, I COULDNT FOLLOW U..PLS GIVE ME A REMEDY OTHERWISE GIVE ME SOMEOTHER SAMPLE CODING
mnda at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 3
What error?Please don't cross post. You've already asked this question elsewhere and received 3 pages of answers!Why are you wasting our time?
ChristopherAngela at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 4
> SORRY SIR, I COULDNT FOLLOW U..PLS GIVE ME A REMEDY> OTHERWISE GIVE ME SOMEOTHER SAMPLE CODINGyou haven't told us what the error is
georgemca at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 5

the error is

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:

[javac] C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-modules\__default-web-module-server\org\apache\jsp\reply1_jsp.java:88: incompatible types

[javac] found: int

[javac] required: java.sql.Statement

[javac] st = st.executeUpdate("INSERT INTO Table9 values (' "+user+" ',' "+pwd+" ' )");

[javac] ^

[javac] 1 error

mnda at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 6
executeUpdate returns an int, and you're trying - for some reason - to assign it back to the Statement reference, st. assign the return value to an int variable
georgemca at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 7

> the error is

>

> org.apache.jasper.JasperException: Unable to compile

> class for JSP

>

> Generated servlet error:

> [javac]

> C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-m

> dules\__default-web-module-server\org\apache\jsp\reply

> 1_jsp.java:88: incompatible types

>[javac] found: int

> [javac] required: java.sql.Statement

> [javac] st = st.executeUpdate("INSERT INTO Table9

> values (' "+user+" ',' "+pwd+" ' )");

>[javac] ^

> [javac] 1 error

Weren't you given already a solution to that particular error in one of your cross-posts in the JSP forum?

karma-9a at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 8

> > the error is

> >

> > org.apache.jasper.JasperException: Unable to

> compile

> > class for JSP

> >

> > Generated servlet error:

> > [javac]

> >

> C:\Sun\AppServer\domains\domain1\generated\jsp\j2ee-m

> >

> dules\__default-web-module-server\org\apache\jsp\reply

>

> > 1_jsp.java:88: incompatible types

> >[javac] found: int

> > [javac] required: java.sql.Statement

> > [javac] st = st.executeUpdate("INSERT INTO Table9

> > values (' "+user+" ',' "+pwd+" ' )");

> >[javac] ^

> > [javac] 1 error

>

>

>

> Weren't you given already a solution to that

> particular error in one of your cross-posts in the

> JSP forum?

as usual, they're not looking for a solution, then. they're looking for someone to re-write the code for them. I hope I never have to work alongside any of these people

georgemca at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...
# 9
well, at least they're smart enough to not attempt to defend their hideous programming practices...
jwentinga at 2007-7-12 2:37:54 > top of Java-index,Java Essentials,New To Java...