Question
How do you handle SQL NULL values in Java

Answers

SQL's use of NULL values and Java's use of null are different concepts. There are three tactics you can use

Avoid using getXXX( ) methods that return primitive data types.
Use wrapper classes for primitive data types, and use the ResultSet object's wasNull( ) method to test whether the wrapper class variable that received the value returned by the getXXX( ) method should be set to null.
Use primitive data types and the ResultSet object's wasNull( ) method to test whether the primitive variable that received the value returned by the getXXX( ) method should be set to an acceptable value that you've chosen to represent a NULL.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Fraction of volume of ice seen outside when immersed in water?
  • Q Which family,order does the fish Barracudina belongs to?
  • Q Find the height of a parallelo gram if its area is 246cm2 and base is 20cm.
  • Q Tell about current five year plan and newly formed NITI Aayog?
  • Q Which Award is given to best goal keeper in FIFA World Cup?
  • Q Is it possible to substitute "ls" command in the place of "echo" command
  • Q What are the required and optional steps for setting up flexfields?
  • Q What are monosaccharides, oligosaccharides and polysaccharides?
  • Q Describe the biochemical mechanisms of toxicity.
  • Q Where can I get this 'Books Online' documentation?
  • Q Which Asian Archery team won Gold and a Bronze Medal in Asian Archery Grand Prix held on March 12, 2013?