jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes problem with textfield Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "problem with textfield" Watch "problem with textfield" New topic

problem with textfield

kstalin babu

Joined: May 18, 2004
Posts: 7
hello one and all,
here is the code....

String scn=bcrc_scno.getText();
int prn=Integer.parseInt(bcrc_prno.getText());
int mamt=Integer.parseInt(bcrc_misamt.getText());
int recon=Integer.parseInt(bcrc_reconchg.getText());
String brn=bcrc_brno.getText();
String ptr=bcrc_ptrdt.getText();
String mamtcd=bcrc_misamtcd.getText();

con = DriverManager.getConnection("Jdbc dbc:venkat","scott"," tiger");
Statement stmt = con.createStatement();
System.out.println("connection established......XXXXXXXXXXX");

/* columns in the table payment1 ptscno,ptprno,ptmisamt,ptreconchg,ptbcrno,ptprdt,ptmisamtcd */

stmt.executeUpdate("insert into payment1(ptscno,ptprno,ptmisamt,ptreconchg,ptbcrno,ptprdt,ptmisamtcd) values (scn,prn,mamt,recon,brn,ptr,mamtcd)");
}catch(SQLException p){
System.out.println("sorry failed"+p);
}catch(Exception e){
after executing this i am getting column not allowed oracle error
i have taken the data from a textfield.

please help me
thanq in advance
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
I am not an Oracle expert, but I suggest you use the same structure of the query but only update one column at a time to see which column is causing the problem. Also check whether any of your named columns are not updatable, e.g. autonumber.
[ May 18, 2004: Message edited by: Eddie Vanda ]

The nice thing about Standards is that there are so many to choose from!
Abhik Sarkar
Ranch Hand

Joined: Jun 14, 2003
Posts: 61

I think you should be using something like the following instead:

(hope I got all the 's and the brackets right).

Alternately, you could also consider using the PreparedStatement (see API docs for more details).


Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Moving this to the JDBC forum.

GenRocket - Experts at Building Test Data
I agree. Here's the link: http://aspose.com/file-tools
subject: problem with textfield
It's not a secret anymore!