Skip to main content



      Home
Home » Archived » BIRT » I need change the connection of the database JDBC HSQLDB
I need change the connection of the database JDBC HSQLDB [message #91891] Thu, 17 November 2005 05:50 Go to next message
Eclipse UserFriend
Hello to all,

I write an application using the swt library and the Jface. I use as
database HSQLDB driver. In my project I runs the database engine as part
of my application program in the same Java Virtual Machine, so i used:

"Connection c =
DriverManager.getConnection("jdbc:hsqldb:file:mydatabase", "sa", "");"

to connect with the db.

Now I like to integrate in my application the BIRT project, the problem
is that I don't know how connect with the db. In jasper report I used :

JasperPrintManager.printReport(
JasperFillManager.fillReport(jasperReport, parameters,
DbConnection.getReference().getConnection()) , true);

where DbConnection.getReference().getConnection() is the method that
return the Connection with my Standalone db. So i hope there is a
similar method with BIRD project. Can anybody help me?

Thanks to all

Stefano
Re: I need change the connection of the database JDBC HSQLDB [message #92178 is a reply to message #91891] Thu, 17 November 2005 11:34 Go to previous messageGo to next message
Eclipse UserFriend
Stefano,

BIRT has a set of APIs to run a BIRT report. When the Engine runs a report
it looks for the connection information in the design file, which is
typically built in the designer. BIRT also has an API to manipulate the
Design File. I may be misunderstanding what you want.
Are you trying to run a report with the APIs? Are you trying to pass in a
preexisting connection?

Jason Weathersby
BIRT PMC

"Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message
news:dlhn90$8pg$1@news.eclipse.org...
> Hello to all,
>
> I write an application using the swt library and the Jface. I use as
> database HSQLDB driver. In my project I runs the database engine as part
> of my application program in the same Java Virtual Machine, so i used:
>
> "Connection c = DriverManager.getConnection("jdbc:hsqldb:file:mydatabase",
> "sa", "");"
>
> to connect with the db.
>
> Now I like to integrate in my application the BIRT project, the problem is
> that I don't know how connect with the db. In jasper report I used :
>
> JasperPrintManager.printReport( JasperFillManager.fillReport(jasperReport,
> parameters, DbConnection.getReference().getConnection()) , true);
>
> where DbConnection.getReference().getConnection() is the method that
> return the Connection with my Standalone db. So i hope there is a similar
> method with BIRD project. Can anybody help me?
>
> Thanks to all
>
> Stefano
>
>
Re: I need change the connection of the database JDBC HSQLDB [message #92248 is a reply to message #92178] Thu, 17 November 2005 12:27 Go to previous messageGo to next message
Eclipse UserFriend
Jason Weathersby ha scritto:
> Stefano,
>
> BIRT has a set of APIs to run a BIRT report. When the Engine runs a report
> it looks for the connection information in the design file, which is
> typically built in the designer. BIRT also has an API to manipulate the
> Design File. I may be misunderstanding what you want.
> Are you trying to run a report with the APIs? Are you trying to pass in a
> preexisting connection?
>
> Jason Weathersby
> BIRT PMC
>
> "Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message
> news:dlhn90$8pg$1@news.eclipse.org...
>
>> Hello to all,
>>
>> I write an application using the swt library and the Jface. I use as
>> database HSQLDB driver. In my project I runs the database engine as part
>> of my application program in the same Java Virtual Machine, so i used:
>>
>> "Connection c = DriverManager.getConnection("jdbc:hsqldb:file:mydatabase",
>> "sa", "");"
>>
>> to connect with the db.
>>
>> Now I like to integrate in my application the BIRT project, the problem is
>> that I don't know how connect with the db. In jasper report I used :
>>
>> JasperPrintManager.printReport( JasperFillManager.fillReport(jasperReport,
>> parameters, DbConnection.getReference().getConnection()) , true);
>>
>> where DbConnection.getReference().getConnection() is the method that
>> return the Connection with my Standalone db. So i hope there is a similar
>> method with BIRD project. Can anybody help me?
>>
>> Thanks to all
>>
>> Stefano
>>
>>
>>
>
>
>

>Are you trying to run a report with the APIs?
Yes, and I can

>Are you trying to pass in a preexisting connection?
Yes but I don't how
Re: I need change the connection of the database JDBC HSQLDB [message #92294 is a reply to message #92248] Thu, 17 November 2005 13:06 Go to previous messageGo to next message
Eclipse UserFriend
Stefano,

I dont think passing in a connection is supported. You can use the DE API
to write it to the design file. Using a Scripted Data Source you could
probably get a prexisting connection object, but this may be more pain than
it is worth. You could also use script to change connection parameters at
run time, if that is the ultimate goal.

Jason

"Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message
news:dliehi$eng$1@news.eclipse.org...
> Jason Weathersby ha scritto:
>> Stefano,
>>
>> BIRT has a set of APIs to run a BIRT report. When the Engine runs a
>> report it looks for the connection information in the design file, which
>> is typically built in the designer. BIRT also has an API to manipulate
>> the Design File. I may be misunderstanding what you want.
>> Are you trying to run a report with the APIs? Are you trying to pass in
>> a preexisting connection?
>>
>> Jason Weathersby
>> BIRT PMC
>>
>> "Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message
>> news:dlhn90$8pg$1@news.eclipse.org...
>>
>>> Hello to all,
>>>
>>> I write an application using the swt library and the Jface. I use as
>>> database HSQLDB driver. In my project I runs the database engine as part
>>> of my application program in the same Java Virtual Machine, so i used:
>>>
>>> "Connection c =
>>> DriverManager.getConnection("jdbc:hsqldb:file:mydatabase", "sa", "");"
>>>
>>> to connect with the db.
>>>
>>> Now I like to integrate in my application the BIRT project, the problem
>>> is that I don't know how connect with the db. In jasper report I used :
>>>
>>> JasperPrintManager.printReport(
>>> JasperFillManager.fillReport(jasperReport, parameters,
>>> DbConnection.getReference().getConnection()) , true);
>>>
>>> where DbConnection.getReference().getConnection() is the method that
>>> return the Connection with my Standalone db. So i hope there is a
>>> similar method with BIRD project. Can anybody help me?
>>>
>>> Thanks to all
>>>
>>> Stefano
>>>
>>>
>>>
>>
>>
>>
>
>>Are you trying to run a report with the APIs?
> Yes, and I can
>
>>Are you trying to pass in a preexisting connection?
> Yes but I don't how
Re: I need change the connection of the database JDBC HSQLDB [message #92427 is a reply to message #92294] Fri, 18 November 2005 02:37 Go to previous messageGo to next message
Eclipse UserFriend
Jason Weathersby ha scritto:
> Stefano,
>
> I dont think passing in a connection is supported. You can use the DE API
> to write it to the design file. Using a Scripted Data Source you could
> probably get a prexisting connection object, but this may be more pain than
> it is worth. You could also use script to change connection parameters at
> run time, if that is the ultimate goal
>
Thanks Jason,
I'll try to use the script to change the connection parameters... so
an other small request O:-) : You have some idea for to do this?
If yes, I will be recognizing to you.

Stefano
Re: I need change the connection of the database JDBC HSQLDB [message #92442 is a reply to message #92427] Fri, 18 November 2005 02:46 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------020407000207010405080109
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

You excuse to me ,
I found this link

http://www.eclipse.org/birt/wiki/index.php?n=BPS.BPS35,

there is script:

/Some examples of the types of external context objects that may be
passed through to a BIRT data source provider include: /

* /An open JDBC connection /
* /A pooled connection /
* /User authorization keys /
* /Query parameter values collected outside of BIRT/


what do you think about?

Ciao
Stefano

--------------020407000207010405080109
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
You excuse to me ,<br>
Re: I need change the connection of the database JDBC HSQLDB [message #92623 is a reply to message #92442] Fri, 18 November 2005 10:11 Go to previous message
Eclipse UserFriend
This is a multi-part message in MIME format.

------=_NextPart_000_001C_01C5EC28.627FB230
Content-Type: text/plain;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Stefano,
From the FAQ

Is it possible getting database's information from a DataSource? object =
with the API?

Gary Xue=20
The best way to achieve this is to edit the beforeOpen script of the =
data source object to set the runtime information of the data source. To =
do this, right click on your JDBC data source and select "Edit Code". In =
the method dropdown list, select "beforeOpen". In the code editor, write =
a script like this:=20

=20
extensionProperties.odaUser =3D "sesame";
extensionProperties.odaPassword =3D "open";
extensionProperties.odaURL =3D "jdbc:my_data_source:....";
extensionProperties.odaDriverClass =3D "com.mycompany.jdbc.Driver";
=20
Refer to the BIRT ROM scripting spec for more information about =
scripting ingeneral. The names of the properties that you can set =
(odaUser, odaPassword, etc.) are defined by the ODA extension. The =
BIRT-shipped ODA-JDBC driver extension recognizes the above 4 =
properties.=20

Jason Weathersby

BIRT PMC

"Stefano Zaccaria" <szaccaria@cedacosrl.it> wrote in message =
news:dlk0sr$esc$1@news.eclipse.org...
You excuse to me ,
I found this link=20

http://www.eclipse.org/birt/wiki/index.php?n=3DBPS.BPS35,=20

there is script:


Some examples of the types of external context objects that may be =
passed through to a BIRT data source provider include:=20

a.. An open JDBC connection=20
b.. A pooled connection=20
c.. User authorization keys=20
d.. Query parameter values collected outside of BIRT=20

what do you think about?

Ciao
Stefano
------=_NextPart_000_001C_01C5EC28.627FB230
Content-Type: text/html;
charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-15>
<META content=3D"MSHTML 6.00.2900.2769" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Stefano,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>From the FAQ</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>
<P class=3Dquestion>Is it possible getting database's information from a =
<A=20
class=3Dcreatelinktext=20
href=3D" http://www.eclipse.org/birt/wiki/index.php?n=3DFAQ.DataSourc e?act=
ion=3Dedit">DataSource</A><A=20
class=3Dcreatelink=20
href=3D" http://www.eclipse.org/birt/wiki/index.php?n=3DFAQ.DataSourc e?act=
ion=3Dedit"><FONT=20
size=3D1>?</FONT></A> object with the API?</P>
<P>Gary Xue <BR>The best way to achieve this is to edit the beforeOpen =
script of=20
the data source object to set the runtime information of the data =
source. To do=20
this, right click on your JDBC data source and select "Edit Code". In =
the method=20
dropdown list, select "beforeOpen". In the code editor, write a script =
like=20
this: </P><PRE>=20
extensionProperties.odaUser =3D "sesame";
extensionProperties.odaPassword =3D "open";
extensionProperties.odaURL =3D "jdbc:my_data_source:....";
extensionProperties.odaDriverClass =3D "com.mycompany.jdbc.Driver";
=20
</PRE>
<P>Refer to the BIRT ROM scripting spec for more information about =
scripting=20
ingeneral. The names of the properties that you can set (odaUser, =
odaPassword,=20
etc.) are defined by the ODA extension. The BIRT-shipped ODA-JDBC driver =

extension recognizes the above 4 properties. </P>
<P>Jason Weathersby</P>
<P>BIRT PMC</P></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Stefano Zaccaria" &lt;<A=20
href=3D"mailto:szaccaria@cedacosrl.it">szaccaria@cedacosrl.it</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:dlk0sr$esc$1@news.eclipse.org">news:dlk0sr$esc$1@news.eclips=
e.org</A>...</DIV>You=20
excuse to me ,<BR>&nbsp;&nbsp;&nbsp;&nbsp; I found this link =
<BR><BR><A=20
class=3Dmoz-txt-link-freetext=20
=
href=3D"http://www.eclipse.org/birt/wiki/index.php?n=3DBPS.BPS35">http://=
www.eclipse.org/birt/wiki/index.php?n=3DBPS.BPS35</A>,=20
<BR><BR>there is script:<BR><BR>
<P><I>Some examples of the types of external context objects that may =
be=20
passed through to a BIRT data source provider include: </I></P>
<UL>
<LI><I>An open JDBC connection </I>
<LI><I>A pooled connection </I>
<LI><I>User authorization keys </I>
<LI><I>Query parameter values collected outside of BIRT</I> =
</LI></UL><BR>what=20
do you think about?<BR><BR>Ciao<BR>Stefano </BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_001C_01C5EC28.627FB230--
Previous Topic:Chart CallBackValue Usage
Next Topic:meter/dial chart
Goto Forum:
  


Current Time: Tue Jul 22 15:54:58 EDT 2025

Powered by FUDForum. Page generated in 0.05762 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top