• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing sql table data as report in JDBC

 
Pritam Chatterjee
Ranch Hand
Posts: 38
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to select all the rows from a MySQL table in JDBC.
That I can do using statements, query & resultset.

Then I want to display the output as a report, like we make report in MS Access.
I can't find the way.
Please help.
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to look into a reporting software such as Jasper Report to build a template of the report then use sql to populate it.
 
Pritam Chatterjee
Ranch Hand
Posts: 38
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So do I need to install Jasper Report.
Then how will I populate data in it through MySQL.
 
K. Tsang
Bartender
Posts: 3583
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm the sql is embed inside the report. If you don't like hard-coding then you probably want to use a view or store procedure.

Yet no matter what approach you use, if the report needs to add or remove a column/field then the report source needs changing (hence the sql too)
 
Pritam Chatterjee
Ranch Hand
Posts: 38
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you share the full code or a good link..
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just search for JasperReports, there's tons of material on its site and elsewhere in the web. It doesn't make sense to give an introduction here when all that is already available. The http://www.coderanch.com/how-to/java/OtherOpenSourceProjectsFaq also points to introductory material.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic