Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
Proper way for Javascript to read MySQL data through Java

I am now learning while developing my Java web app using JSF, and I was asked to study on using Javascript to create datatable/report dynamically and present it via .html/.xhtml. I am required to use Datatables.net to produce the table. The backend process is using Java instead of Php. Since it is so rare to use this method, I got no idea on this. My thought so far is:

MySQL data --convert to (processed by Java code)--> Json --read by-> Javascript

How do I process the SQL data? Can I directly run the query inside Java like:

SELECT 
CONCAT("[",
     GROUP_CONCAT(
          CONCAT("{name:'",NAME,"'"),
          CONCAT("email:'",email,"'"),
          CONCAT(",address:'",address,"'}")
     )
,"]") AS JSON FROM customer

If so, how do I parse the data out and make sure Javascript will read it?

The another way I found is to use some library like Gson or something similar.

Explanations or examples about this issue is much appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!