Article View: borland.public.jbuilder.java.language
Article #226How to connect JasperReport on JBuilder data module with JDataStore database query
From: Brunet Djura
Date: Sun, 12 Feb 2006 16:00
Date: Sun, 12 Feb 2006 16:00
44 lines
2505 bytes
2505 bytes
I'm working on a database application in Borland JBuilder 2006 on Linux
Fedora Core 4 platform. I choose JDataStore as database, and
JasperReports for reporting part.
Is there a way to connect JasperReport and JBuilder data module
JDataStore database connection ?
My JasperReport/JDataStore connection code now looks like this >
try {
String FILE =
"/home/brunetdj/my/source/jbuilder/info2006/rpt/pregled.jrxml";
JasperPrint jasperPrint = new JasperPrint();
Map inputParameters = new HashMap();
Connection rpt_db = null;
try {
Class.forName("com.borland.datastore.jdbc.DataStoreDriver");
} catch (ClassNotFoundException ex) {
}
try {
rpt_db =
DriverManager.getConnection("jdbc:borland:dslocal:/home/brunetdj/my/source/jbuilder/info2006/data/podaci.jds",
"SYSDBA",
"masterkey");
} catch (SQLException ex1) {
}
inputParameters.put("sometitle","first report");
JasperReport jasper_report =
JasperCompileManager.compileReport(FILE);
JasperPrint printed_report =
JasperFillManager.fillReport(jasper_report,
inputParameters, rpt_db);
JasperViewer.viewReport(printed_report,false);
}
catch (JRException excecao) {
System.out.println("Error: " + excecao.getMessage());
}
Please, help, if any can ...
P.S. Point is to put in rpt_db my JBuilder data module connection.
Technical Details
Message-ID:
<43ef5a1c@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f74b3,d90d62c81cd9b3f9,start X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 12 Feb 2006 17:00:30 +0100 From: Brunet Djura <djura.brunet@pkv.co.yu> User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: How to connect JasperReport on JBuilder data module with JDataStore database query Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 213.240.36.10 Message-ID: <43ef5a1c@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1139759644 213.240.36.10 (12 Feb 2006 07:54:04 -0700) Lines: 44 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail