Hi Friends,
In my project, i want to update excel values to the database....but my database did not get negative values...please any one help me...how to insert negative values to database.............
>>>>Thanks and Regards
Vasanth Jayaraman
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hi Friends,
In my project, i want to update excel values to the database....but my database did not get negative values...please any one help me...how to insert negative values to database.............
>>>>Thanks and Regards
Vasanth Jayaraman
Change your code!
Improving the world one idiot at a time!
Thanks for your Response....
this is my excel sheet img
my code
for(int i=1; i<=sheet.getLastRowNum(); i++){ row = sheet.getRow(i); // int id=0; int time = (int) row.getCell(0).getNumericCellValue(); int xaxis = (int) row.getCell(1).getNumericCellValue(); int yaxis = (int) row.getCell(2).getNumericCellValue(); int zaxis = (int) row.getCell(3).getNumericCellValue(); // String name = row.getCell(1).getStringCellValue(); // String salary = row.getCell(2).getStringCellValue(); // String sql = "INSERT INTO datas VALUES('"+id+"','"+name+"','"+salary+"')"; String sql = "INSERT INTO datas VALUES('"+time+"','"+xaxis+"','"+yaxis+"','"+zaxis+"')"; pstm = (PreparedStatement) con.prepareStatement(sql); pstm.execute();
and my output like
What do you mean by this? Do you mean when you try to insert a negative value into a column, it is non-negative after insertion? Is the column the correct data type to store negative values (eg, is it signed or unsigned?)but my database did not get negative values