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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:47:19+00:00 2026-05-26T10:47:19+00:00

I am designing a web application that retrieves records from a database according to

  • 0

I am designing a web application that retrieves records from a database according to user search criteria. After retrieving results, another stage exists in the flow in which the results are “decorated” with additional data.

For example, we may have a Persons database table with columns such as: name, age, height, weight. The program can filter that table by a certain logical computation formula, e.g. keep all Person records where the person’s weight is less than her “ideal weight”, defined as:

IDEAL_WEIGHT = (height/100) * age

So, we will show all records where IDEAL_WEIGHT < weight, this can be accomplished with SQL, stored procedures, etc – bottom line is that we filter with SQL. Concerning the “results decoration” stage, it can be, for example, calculating the WEIGHT_PER_INCH for each result, defined as

WEIGHT_PER_INCH = height / weight

These “decoration” computations may be a lot more complex than the above, and are actually broader than mathematical formulas – they may involve data residing on remote hosts, or rely on other computations units. So – it seems SQL and probably PL/SQL are not suited for the job, rather Java is – bottom line is that we “decorate” with Java.

Now, what we mentioned above is filtering by IDEAL_WEIGHT and decorating with WEIGHT_PER_INCH, but what happens if we want to be able to have it the other way around? (i.e. filter by WEIGHT_PER_INCH and decorate with IDEAL_WEIGHT).

You may say that all these computation units should be of one type – either stored SQL procedures, or Java classes. But if they’re SQL procedures they are not expressive enough, and if they are Java classes, they cannot be used to search a database quickly.

My question is:

Is there a clean, widely-used, fast way to invoke Java from SQL, e.g.

Select * from Persons p where IDEAL_WEIGHT(p) < p.weight

where IDEAL_WEIGHT() is a Java method, not an SQL procedure.

or: Is there some other way around all this?

Thanks a bunch for your thoughts.

  • 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-26T10:47:20+00:00Added an answer on May 26, 2026 at 10:47 am

    I am afraid this idea is unfeasible in general (more so if you are using MySQL).

    There has been some effort to make Java directly invokable by MySQL, as you can see here:

    How to Call Java Code from MySQL?

    but apparently this didn’t get any further development (the only references I found through an admittedly cursory google search are from 2008).

    Some other RDBMS allowed (or maybe still allow) to use Java to write stored procedure. Oracle for sure, and someone has already mentioned Postgres.
    The point is that even in the case of Oracle (which uses an embedded JVM) you have to deal with some limitations – I doubt you could really write a stored procedure which can use the full set of Java libraries, or that can invoke remote services etc.

    Please understand that a RDBMS is a sort of “ideal world” which is supposed to be auto-consistent. The idea that a query may be filtered (or decorated) with facts from the outside world goes against the grain of the RDBMS philosophy (and would make the Query Engine unable to make any intelligent choice on how to perform the query) so I really doubt this could work in any useful way.

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

Sidebar

Related Questions

I'm designing a web driven SQL database application from ground up. The application will
I am designing a web application that does server side image processing in real
I'm in a process of designing a multi-tier ASP.NET web application that is supposed
I'm designing a new web application and I'm aware that the process of registration
I'm designing my database and LINQ To SQL ASP.NET web application. Imagine I have
I'm designing a small SQL database to be used by a web application. Let's
I have a unique issue - I am designing a web application that creates
I have never designed a database/data-model/schema from scratch, especially for a web-application. In some
I am designing a web based chat feature for an application that will work
I'm currently designing an architecture for a web-based application that should also provide some

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.