• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using multiple SQL server connections with Ireport and Jboss with WebServlet  RSS feed

Rudi Steenberg
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I am not sure how to connect to multiple databases using ireport and jboss.
I am currently using the following code to create the connection

private Connection getDBConnection()
Connection con = null;
String databaseUsername = "";
String databasePassword = "";
String url = "";
String databaseClass = propertiesFile.getProperty("databaseClass");
url = (new StringBuilder(String.valueOf(propertiesFile.getProperty("databaseURL")))).append(propertiesFile.getProperty("databaseServer")).append(":").append(propertiesFile.getProperty("databasePort")).append(";databaseName=").append(propertiesFile.getProperty("databaseName")).append(";selectMethod=cursor;").toString();
databaseUsername = propertiesFile.getProperty("databaseUsername");
databasePassword = propertiesFile.getProperty("databasePassword");
con = DriverManager.getConnection(url, databaseUsername, databasePassword);
System.out.println("Connected to sql : SUCCESSFULL");
catch(Throwable exc)
return con;

Which works fine for a single report using one connection. I need to be able to connect to a couple of different DB's which are all on the same SQL server.

Any help or additional info you guys could offer would be greatly appreciated.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!