"Statement" declaration while using JDBC and Access in JSP pages
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Uma_Varadharajan
Posted On:   Thursday, June 7, 2001 02:11 PM

I am trying to use JSP to validate a form. There are 2 fields, customerID and Code. These are stored in an Access Table, REC, with 2 columns,CustomerID and Code. I am using a string to set up Statement as follows: String insertion = "INSERT INTO Rec("customerID","Code") VALUES ('" + this.getcustomerID() + "','" + this.getCode() +"')";> int stmtInt = Stmt.executeUpdate(insertion); Stmt.close(); I am getting the an SQL error, which shows that the column definition : REC("customerID","Code") is wrong. I did get the programs to work for   More>>

I am trying to use JSP to validate a form. There are 2 fields, customerID and Code.


These are stored in an Access Table, REC, with 2 columns,CustomerID and Code.
I am using a string to set up Statement as follows:


String insertion = "INSERT INTO Rec("customerID","Code") VALUES ('" + this.getcustomerID() + "','" + this.getCode() +"')";>




int stmtInt = Stmt.executeUpdate(insertion);


Stmt.close();


I am getting the an SQL error, which shows that the column definition :


REC("customerID","Code")


is wrong. I did get the programs to work for a single column table(with no quotes required in the sql statement).
Very grateful if you could advise me.

   <<Less

Re: &quot;Statement&quot; declaration while using JDBC and Access in JSP pages

Posted By:   Luigi_Viggiano  
Posted On:   Thursday, June 7, 2001 02:43 PM

I don't think it's necessary to put quotes on table names... I think they are interpreted as values instead as identifiers by the database. Try removing double quotes : REC(customerID,Code)
About | Sitemap | Contact