• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with textfield

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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();

try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("Jdbc dbc:venkat","scott"," tiger");
con.setAutoCommit(false);
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)");
con.commit();
con.setAutoCommit(true);
con.close();
}catch(SQLException p){
System.out.println("sorry failed"+p);
p.printStackTrace();
}catch(Exception e){
System.out.print(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
stalin.
 
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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).

HTH,

Abhik.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the JDBC forum.
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic