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 8712229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:04:03+00:00 2026-06-13T05:04:03+00:00

To catch an empty field out of my DB I use following code: int

  • 0

To catch an empty field out of my DB I use following code:

int score;
            if (c.isNull(11)) {
                score = 100;
            } else {
                score = c.getInt(11);
            }
            q.setScore(score);

But, it seems now that when I accidently have highlighted a cell in SQL Lite browser in the past, and export it (even left empty) it doesn’t appear as NULL anymore, but as ''
. I tried c.getInt(11) = ''but then again, this is not working…

Any ideas on how I could catch the '' as well?

  • 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-06-13T05:04:04+00:00Added an answer on June 13, 2026 at 5:04 am

    If you are using getInt(), null and “empty” SQL values becomes 0 in Java (since null is not a valid Integer value), so use:

    if(c.getInt(11) == 0) 
    

    If this creates a logic problem since 0 might mean somthing else in your context, you can run an UPDATE command on your table to change every '' value to -1 in this particular column.

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

Sidebar

Related Questions

i want to make empty textbox checking for android. i tried try catch but
I used the following code.... <html> <head> <% String loginstatus=request.getParameter(loginstatus); String option=request.getParameter(option); //out.println(option); %>
I would like to test some exception handling logic in the empty catch block
I'm trying to catch a double-click event in a TreeView's empty area to create
Code: catch (IOException e) { LOGGER.error(IOException exception happened); //now need throw again the same
I'm trying to catch a JSON object with a mouse click event. I use
How to catch return hit (enter) on TextBox? The following does not work. I
I'm wondering how one can catch and add a custom handler when empty results
My code can see the non-public members, but not the public ones. Why? FieldInfo[]
I've added a validation function to my search bar to catch empty submissions. If

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.