sir 1 Answer(s) 3 years and a month ago
Posted in : Java Beginners
hi sir,in this program there is a jtable,i am insert the records to the jtable .when i am inserting the record to the 5th row of the jtable,the inserting query is not executed,plz see this program and provide solution
sir,i am mentioning the error as <<>>>......main bug here>........ in this program,plz see and provide solution sir,database Tables are mentioning below the program sir
String item1,p1,p2,p3,p4,pname1; int count1=0,sum; Validator v; Connection connect; JTable daytable; ResultSet rs,rs1,rs2; JComboBox jb,jb1,batchid; PreparedStatement pst; Statement stmt,s; static final int ITEMID_COLUMN_INDEX=3; static final int QUANTITY_COLUMN_INDEX=4; static final int PRICE_COLUMN_INDEX=6; static final int AMOUNT_COLUMN_INDEX=7; static final int SNO_COLUMN_INDEX=0; int count11; String sno; //setLayout(null); JPanel jp,mainPanel; String d; double paid,change; int k;int roecount; String rajesh,item2,item3,item4; String x,y; JLabel titleLabel,cityLabel,totalamountLabel,city1Label,cusnameLabel,dateLabel,tidLabel,amtpaidLabel,changeLabel; JTextField totalamountField=null,city1Field=null,cusnameField=null,dateField=null,tidField=null,amtpaidField,changeField; JButton print,update; double sum12;
DefaultTableModel model ; String sql;String total=null, city=null, cusname=null,date=null,tid=null; public SalesInformation() { try{ Class.forName("oracle.jdbc.OracleDriver"); connect =DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","chinna"); stmt = connect.createStatement(); }catch(Exception e){System.out.println(e.getMessage());}
Font labelFont=new Font("timesroman",Font.BOLD,20); Color c=new Color(236,233,216); //Color c=new Color(236,233,255); setSize(1024,618); setLayout(null);
try{ Class.forName("oracle.jdbc.OracleDriver"); Connection con =DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","chinna"); Statement st = con.createStatement();
String sql="select distinct(pname) from productid"; rs=st.executeQuery(sql);
String data[][] = {null}; String col[] = {"Sno","ptype","PName","ItemId","Quantity","BatchId","unit_Price","Amount"}; model = new DefaultTableModel(data,col){ public boolean isCellEditable(int row, int col) {
int item5=Integer.parseInt(item4); System.out.println("error.chinna111.....qty.............."+item5); System.out.println("error.chinna111....ptype..............."+item1); System.out.println("error.chinna111.......pname............"+item2);
<>>>.....................This is the main bug sir>>..................... try{
batchid.removeAllItems();
Class.forName("oracle.jdbc.OracleDriver"); Connection c =DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","system","chinna"); Statement s1= c.createStatement(); sql = "select batchid from purchaseorder where ptype=\'"+item1+"\' and pname=\'"+item2+"\' and qty>=\'"+item5+"\'";
total=totalamountField.getText().trim(); //System.out.println("total.........."+total); city= city1Field.getText().trim(); //System.out.println("cityl.........."+city); cusname=cusnameField.getText().trim(); //System.out.println("cusname......."+cusname); date=dateField.getText().trim(); //System.out.println("date......."+date); String dd=date.substring(0,2); int dd1=Integer.parseInt(dd); // System.out.println(dd+"th55555dhjd"); String mm=date.substring(3,5); int mm1=Integer.parseInt(mm);
// System.out.println("month:"+mm1); //System.out.println(mm+"sdfsfsv"); String yyyy=date.substring(6,10); int yyyy1=Integer.parseInt(yyyy); //System.out.println(yyyy1+"dfdvd");
if((mm1<=12 &&mm1>=1)&&(dd1<=31 &&dd1>=1)) {
String mon=null; switch(mm1){
case 1:mon="jan"; break; case 2:mon="feb"; break; case 3:mon="mar"; break; case 4:mon="apr"; break; case 5:mon="may"; break; case 6:mon="jun"; break; case 7:mon="jul"; break; case 8:mon="aug"; break; case 9:mon="sep"; break; case 10:mon="oct"; break; case 11:mon="nov"; break; case 12:mon="dec"; break; }
int update=Integer.parseInt(x); String query100="select qty from purchaseorder where batchid=\'"+y+"\'"; int k; try { rs1=stmt.executeQuery(query100); while(rs1.next()) { int updatebase=rs1.getInt(1); int remain=updatebase-update; String query10="update purchaseorder set qty=\'"+remain+"\' where batchid=\'"+y+"\'";
try { PreparedStatement pst3=connect.prepareStatement(query10); k=pst3.executeUpdate(); System.out.print(" "+k); if(k>0){ JOptionPane.showMessageDialog(null,"Quantity is successfully updated in purchaseorder Table"); } connect.setAutoCommit(true); } catch(Exception ie){ System.out.print("error in update"+ie); }
hi sir - Java Beginners
hi sir Hi,sir,i am try in netbeans for to develop the swings,plz provide details about the how to run a program in netbeans and details about... the details sir,
Thanks for ur coporation sir Hi Friend
sir - Java Beginners
sir hi sir,in this program there is a jtable,i am insert...
sir,i am mentioning the error as <<>>>......main bug here>........ in this program,plz see and provide solution sir,database Tables
sir - Java Beginners
sir hi sir,Happy ugadi,how to place the database records into jtable ,i am using the oracle database plz provide the program how to retrieve the database records and placed into a jtable,i want one more column is added to my
more doubts sir. - Java Beginners
more doubts sir. Hello sir,
Sir i have executed your code and i got the result but the problem is whenever i click on the link in my... own browser.Hope you will help me out.And also sir i need the progressbar
sir i,have a assignment for these question plz help me sir - JavaMail sir i,have a assignment for these question plz help me sir
1.Design a Java interface for ADT Stack. Develop two different classes that implement this interface, one using array and the other using linked-list. Provide
Dear Sir I need to join u
Dear Sir I need to join u Dear Sir
i am santosh Rai from Saudi Arabia please make me understood how to join u and i have one question
i want to working with you
what is ur process for working with u please send me
swing program plz urgent sir - Java Beginners
swing program plz urgent sir
hi sir,i waan a jtable swings program table having column names "itemid","price".Initially table having single empty row.whenever we click the "enter" button automatically new row will be insert
pls help me sir its urgent
pls help me sir its urgent thanks for reply,
but i am getting this error pls help me its urgent
type Exception report
message
description The server encountered an internal error () that prevented it from
Plz reply me sir Its urgent - JSP-Servlet
Plz reply me sir Its urgent Respected Sir/madam,
I am R.Ragavendran..Actuaaly,I request you to remember the code which you have provided for me using radio buttons..
You have used the following syntax for checking whether
please do respond to my problem sooooon sir - Java Beginners
please do respond to my problem sooooon sir Hello sir,
Sir i have executed your code and i got the result but the problem is whenever i click... to open the link also in my own browser.Hope you will help me out.And also sir i need
hello sir, please give me answer - Java Beginners
hello sir, please give me answer Write a program in Java that calculates the sum of digits of an input number, prints... ways in java? so , sir please tell me full solution of this program Here is your complete
sir plz do respond to my problem immediately - Java Beginners sir plz do respond to my problem immediately Hello sir,
Iam very happy that you have responded to my problem.The code u sent for the progree bar is a separate program. sir i need to put it in my web browser.sir iam
About Metcalfe House of Delhi
was built as a home for
Sir Thomas Metcalfe in 1835. Metcalfe was a leader.... However, it was taken in by Sir Theophilus Metcalfe, the son
and heir of Sir
hi - Java Beginners
hi hi sir,create a new button and embed the datepicker code to that button sir,plzzzzzzzzzzzzzzzzzzzzzzzzzzz
programming of foxpro
programming of foxpro hello sir ,
sir i am use the foxpro . but i know about c . sir how can i learn fox pro . i know about something about foxpro