java servlet
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
import java.awt.*;
import java.lang.Math;
public class register extends HttpServlet
{
Connection connection;
String name, customerid, address, email, password, accountid,description;
private Connection con = null;
public Statement s = null;
private ResultSet rs = null;
String bigDecimal;
public String URL = "org.gjt.mm.mysql.Driver";
public void init()
{
try
{
Class.forName("org.gjt.mm.mysql.Driver");
Connection con = DriverManager.getConnection
("jdbc:mysql://urlport/user","user","password");
String conStr = "jdbc:mysql://("urlport/user","user","password"&jdbcCompliantTruncation=false";
Statement stmt = con.createStatement();
stmt.executeUpdate( "CREATE TABLE customers (" +
"name text NOT NULL, " +
"customerid int (10) NOT NULL primary key auto_increment, " +
"address text (25) NOT NULL, " +
"email text (20) NOT NULL, " +
"password text (10) NOT NULL," +
"description CHAR (20) NOT NULL," +
")" );
stmt.executeUpdate( "CREATE TABLE accounts (" +
"customerid int (10) NOT NULL, " +
"accountid int (10) NOT NULL primary key auto_increment, " +
"balance text (10) NOT NULL, " +
"overdraft text (10) NOT NULL," +
"description CHAR (20) NOT NULL, " +
")" );
}
catch (Exception e)
{
e.printStackTrace();
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
PrintWriter out = response.getWriter();
response.setContentType("text/html");
out.println("<HTML>");
out.println("<BODY>");
String name = request.getParameter("name");
String address = request.getParameter("address");
String email = request.getParameter("email");
String password = request.getParameter("password");
String account_desc = request.getParameter("description");
String balance = request.getParameter("balance");
String overdraft = request.getParameter("overdraft");
try // try to add data to the database
{
Class.forName("org.gjt.mm.mysql.Driver");
Connection con = DriverManager.getConnection
("jdbc:mysql://urlport/user","user","password");
Statement st = con.createStatement();
st.executeUpdate("insert into customers ("+"name,address, email,password,description,customerid)values('"+name+"','"+address+"', '"+email+"', '"+password+"','"+description+"', customerid)");
st.executeUpdate("insert into accounts ("+"customerid,accountid,balance, overdraft, description) values(customerid,accountid, '"+balance+"', '"+overdraft+"','"+description+"')where (customers.'"+customerid+"'=accounts.'"+customerid+"')");
I think my problem is on the red code
Can you help :([/SIZE][/SIZE]

