1

I am not exactly sure what the best approach here is. I am a novice programmer, trying to learn Java and I have a task I would like to complete. I have data in a Excel file. The Excel file has multiple columns. I need to take a the value from a particular column, use it to query a database. If the query returns null then add a value to a column, or mark it some how. If the the query returns a value then do nothing. Move to the next line.

anyone want to throw a noob a bone?

1

3 Answers 3

1

See this. This is the answer I think. http://poi.apache.org/

Sign up to request clarification or add additional context in comments.

Comments

0

I would look at using Apache POI for extracting the data from the excel file and MyBatis for database mapping/interaction.

Of course we can't write the code for you, but those two resources should give you a kickstart. Once you start writing the code, and you find yourself struggling, then I would post back here with code examples of what you're trying to achieve.

Comments

0

Try to use Apache POI jar,

FileInputStream fis = new FileInputStream(FILE_NAME);
XSSFWorkbook workbook = new XSSFWorkbook(fis);
Sheet sheet = workbook.getSheet(READ_PARTICULAR_SHEET);

for (Row readRow : sheet)
{
    for (Cell readCell : readRow)
    {
       if (readCell.getCellType() == ANY_THING)
       {
         //anything you want
       }
    }
}

For reference here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.