Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

I got error java.lang.NumberFormatException: For input string

mahmoudEgyAdfApr 7 2015 — edited Apr 8 2015

Using Jdeveloper 12C, Oracle DB 12C, Windows 8.1 this is my code to read Excel File to DB.

FileInputStream file = new FileInputStream

(new File("E:/Company Mails.xlsx"));

XSSFWorkbook workbook = new XSSFWorkbook(file);

        XSSFSheet sheet = workbook.getSheetAt(0);    

        Iterator\<Row> rowIterator = sheet.iterator();          

        DCBindingContainer bindings2 = (DCBindingContainer) 

BindingContext.getCurrent().getCurrentBindingsEntry();

        JUCtrlHierBinding obj = (JUCtrlHierBinding) 

bindings2.findCtrlBinding("CompanyMails1");

        ViewObject vo = obj.getViewObject();            

        BindingContainer bindings = BindingContext.

getCurrent().getCurrentBindingsEntry();

        OperationBinding operationBinding = bindings.

getOperationBinding("Commit");

                while (rowIterator.hasNext()){                        

                    Row row = rowIterator.next(); 

                    Iterator\<Cell> cellIterator = row.cellIterator();

                    oracle.jbo.Row r = vo.createRow();                        

                    while (cellIterator.hasNext()){

                        Cell cell = cellIterator.next();

                        r.setAttribute("No", row.getCell(0));

                        r.setAttribute("Mail", row.getCell(1));

                        r.setAttribute("Person", row.getCell(2));} }

                file.close(); operationBinding.execute();}

            catch (Exception e){e.printStackTrace(); }

    return null;} 

this is the message I get on the Jdev

java.lang.NumberFormatException: For input string: "No" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)

Untitled.png

"No" as A String is the head of first Column in Excel File this is a pic for the error I got after running the code.

This post has been answered by Cvele_new_account on Apr 7 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2015
Added on Apr 7 2015
6 comments
929 views