• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to connect to data source when making web report?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Background

When users are making web report, they always have to connect to data source. As users’ data requirements are differ in thousand ways, so users often need to define data source by themselves. Sometimes, this may be very complex.

Solution

RAQ Report is a free excel-like java reporting tool. RAQ Report gives two methods to solve this problem.

1. Connect to data source with the API of RAQ Report. And the program is as follows:

context.setDefDataSourceName("demo");
context.setConnection("demo",con);
DataSourceConfig dsoc = new DataSourceConfig(2,
true, "GBK", "GBK", false);
context.setDataSourceConfig("demo", dsoc);

2. Connect to data source with jdbc. And the program is as follows:

public java.sql.Connection getConnection() throws Exception {
Connection conn=null;
try{
Class.forName("org.hsqldb.jdbcDriver");
}catch(ClassNotFoundException cne){
cne.printStackTrace();
}
try{
conn= DriverManager.getConnection("jdbc:hsqldb:hsql://localhost:9001/runqianDB","sa","");
}catch(SQLException e){
e.printStackTrace();
}
return conn;
}

When developing web reporting project, users can connect to data source easily with these two methods provided by RAQ Report. Accoding to real business, users can choose a better one.

 
what if we put solar panels on top of the semi truck trailer? That could power this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic