hello pls let me know whats wrong with following lines of code?

st.execute("insert into user values"+newUser+","+newPass);i am trying to take the values from awt there newuser and newPass are the values taken from the textboxes of the awt
[188 byte] By [mandar-JavaCuriousa] at [2007-11-27 4:50:57]
# 1

> st.execute("insert into user

> values"+newUser+","+newPass);

>

> i am trying to take the values from awt there newuser

> and newPass are the values taken from the textboxes

> of the awt

shouldn't there be a space after values? I would use brackets as well:

st.execute("INSERT INTO USER VALUES("+newUser+" , " + newPass + ")");

bjbaa at 2007-7-12 10:04:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Print it using System.out.println to the console and read it. Is is correct? If you're unsure, copypaste it into your DB admin tool, execute it and check the error message.

This has actually nothing to do with JDBC, but with SQL. Here are some SQL tutorials to work on your SQL knowledge: http://www.google.com/search?q=sql+tutorial

Once you get used with SQL, I recommend you to use PreparedStatement for such queries. You will risk SQL injections otherwise.

BalusCa at 2007-7-12 10:04:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
no its still not working.. its throwing Too many few parameters exception of sql..
mandar-JavaCuriousa at 2007-7-12 10:04:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
Ok.
BalusCa at 2007-7-12 10:04:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
> no its still not working.. its throwing Too many few> parameters exception of sql..I *suspect* that your user table contains more than 2 columns and at least one more that is non nullable. But who can tell really since you won't provide useful information.
cotton.ma at 2007-7-12 10:04:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...