你的 insert 语句是什么? 表结构是什么?

解决方案 »

  1.   

    可能是在INSERT语句中的VALUES中没有值,就 插入默认值了。
      

  2.   

     
         System.out.println( " " +amount+"  "+  price+ "  "+discount+ "  " + brand + "  " +series);
         PreparedStatement st=con.prepareStatement("insert into warehousehandling values(amount,price,discount, brand, series);");  
         
         st.executeUpdate();
    经过测试的,控制台打印出来,都没问题,  
      

  3.   

    是SQL语句生成的问题。
    PreparedStatement st=con.prepareStatement("insert into warehousehandling values("+amount+","+price+","+discount+","+ brand+","+series+")");
    注意如果是字符型的还应加上单引号。