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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:05:33+00:00 2026-05-21T09:05:33+00:00

I am new to H2 database, I ran into a particular problem where I

  • 0

I am new to H2 database, I ran into a particular problem where I was running a function named format.

public static String format(Double sumValue,Integer decimalValue){
 if(sumValue==null)
   return null;
 else{
      //format in particular order.
      }
}

There are chances of sumValue getting null value.

when I am running a query it is throwing a following exception

SELECT format(commamount,2) as formatted FROM pshipcommdetail [90105-153] 
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:327) 
    at org.h2.message.DbException.get(DbException.java:156) 
    at org.h2.message.DbException.convertInvocation(DbException.java:295) 
    at org.h2.engine.FunctionAlias$JavaMethod.getValue(FunctionAlias.java:405) 
    at org.h2.expression.JavaFunction.getValue(JavaFunction.java:38) 
    at org.h2.expression.Alias.getValue(Alias.java:35) 
    at org.h2.command.dml.Select.queryFlat(Select.java:519) 
    at org.h2.command.dml.Select.queryWithoutCache(Select.java:614) 
    at org.h2.command.dml.Query.query(Query.java:269) 
    at org.h2.command.dml.Query.query(Query.java:239) 
    at org.h2.command.dml.Query.query(Query.java:37) 
    at org.h2.command.CommandContainer.query(CommandContainer.java:78) 
    at org.h2.command.Command.executeQuery(Command.java:181) 
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:278) 
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:137) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.NullPointerException 
    at reports.functions.Format.format(Format.java:15) 
    at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.h2.engine.FunctionAlias$JavaMethod.getValue(FunctionAlias.java:393) 

I went through the documentation and was able to figure out that the aruguments should be of wrapper class hence I changed to double!

Can anyone of you please help me to figure out where the actual problem is?

Thanking you

With Regards
Phani Kumar

  • 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-21T09:05:34+00:00Added an answer on May 21, 2026 at 9:05 am

    This question was answered on the H2 mailing list:
    http://groups.google.com/group/h2-database/browse_thread/thread/a4105b923d79bf28#
    It was a bug in Phani’s code.

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

Sidebar

Related Questions

I'm new to VBA and Access in general and ran into this problem whilst
When I am creating a new database table, what factors should I take into
Being new to Linq-to-SQL, I ran into one of it's Gotchas today and I
I ran into a problem as I tried to create two TIMESTAMP columns in
We ran into a problem with out primary key. It was set to a
I am new to C# and Enterprise Library and I ran into some weird
I ran into this problem using EF4 and a self-referential table (implementing an adjacency
Very new to PHP and ran into some trouble and was wondering if anyone
I ran into a strange NHibernate and Automapper problem. I am not sure which
I'm currently working on a medium-sized web project, and I've ran into a problem.

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.