Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 822479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:48:16+00:00 2026-05-15T02:48:16+00:00

I have to read from a ^ delimited file and then pulate a table.

  • 0

I have to read from a ^ delimited file and then pulate a table. Table has nullable integer columns. When there is no value specified in the input file, the column should be made to null.

I need to process the input data first and then insert into the table. So I am reading them into a valueObject with integer data elements. But if I then try to create table rows from the valueObject, integers get converted into 0 values.

How do I avoid this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:48:17+00:00Added an answer on May 15, 2026 at 2:48 am

    I think you have 2 possible ways:

    1/ If you use primitive int: you can use a special code, for example, you can use -1 (in case all other values are positive), you can use Integer.MAX_INTEGER or Integer.MIN_INTEGER. Then, when you put data into the database, you can check for this special code, if the value is equal to the special code, you put the null instead.

    2/ You can use an Integer object, then, if you see no value in file, you you point that object to null. Then when you write to database, it should just work

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: We have to read from a proprietary binary file at work. It changes
I have Uitable with data read from a AScii file. I want to select
I have a problem using data from a tab delimited data file imported with
I need to know how to read data from tabbed delimited text file in
I have a pipe delimited flat file from which I need to deduplicate the
I have read from some article that say's Apple doesn't approve the application which
I have read from this article http://codahale.com/how-to-safely-store-a-password/ and it says using a salt isn't
I have read from the question How to gain access to a ServletContext instance
NOTE: I have read Routing From the Inside Out AND the Engine Yard blog
I have read this article from High Scalability about Stack Overflow and other large

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.