Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting ResultSet from DataStore while using DataExpress

1 view
Skip to first unread message

Edwin Roestenburg

unread,
Jun 30, 2006, 10:49:39 AM6/30/06
to

Context:
DataExpress
JDataStore for local data
MySQL for server data
Possibility of running queries when MySQL is NOT available.

I would like to be able to run JasperReports on my local data (JDataStore), while there is no connection with the SQL server.

Normally I would get a database connection, create a statement, run the query and pass the ResultSet to JasperReports.
When MySQL is not available (e.g. when I don't have my laptop connected to the network) I cannot get a connection on which I could create a statement.

One option I tried is to start "DataStoreServer" from my application, create a remote connection to it, and proceed that way. I do get a connection, but the DataExpress components keep a lock on the database (even though I had understood that it shouldn't when the DataStoreServer is running in the same process as the DataExpress stuff).

In principle I could close all datasets, create a local JDBC connection and so forth. But this would blank out the current data on screen, which I prefer not to do.

My question then is: how can I run a Query that results in a ResultSet when I have no SQL server available, but only the local JDataStore (something like DataStore.executeQuery(query) would be nice).

Steve Shaughnessy

unread,
Jul 9, 2006, 10:55:57 PM7/9/06
to
If there is a lock from the DataExpress components, have you tried calling
commit on the DataStoreConnection component that they are using?

This should allow the JDBC connection to query the database.

-Steve

"Edwin Roestenburg" <EdwinRoe...@yahoo.com> wrote in message
news:44a53a03$1...@newsgroups.borland.com...

Steve Shaughnessy

unread,
Jul 9, 2006, 11:39:55 PM7/9/06
to
Another option is to set the readonly property for your JDBC connection that
is executing the query.

However, it would be good to know why the DataExpress components are not
committing their transactions.

-Steve

"Edwin Roestenburg" <EdwinRoe...@yahoo.com> wrote in message
news:44a53a03$1...@newsgroups.borland.com...
>

Lori M Olson [TeamB]

unread,
Jul 10, 2006, 12:03:59 AM7/10/06
to
Steve Shaughnessy wrote:
> Another option is to set the readonly property for your JDBC connection that
> is executing the query.
>
> However, it would be good to know why the DataExpress components are not
> committing their transactions.
>
> -Steve

Good to see you back, Steve ;-)

--

Regards,

Lori Olson [TeamB]

Steve Shaughnessy

unread,
Jul 10, 2006, 5:30:34 PM7/10/06
to
Thanks Lori.

-Steve

"Lori M Olson [TeamB]" <javad...@techie.com> wrote in message
news:44b1...@newsgroups.borland.com...

Edwin Roestenburg

unread,
Jul 14, 2006, 9:31:17 AM7/14/06
to

Thanks Steve,

both options have the desired effect. For now I will stick with the readOnly option, and I will need to figure out why the DataExpress components aren't committing their transactions.

B.t.w. calling Jasper Reports with a ResultSet from the SQL Server has different behaviour from the same call with the same query, but against the DataStoreServer. (The former works always, the latter not). One difference I notice is in the returned columnnames of the ResultSet. In other words, the ResultSets are different, and JasperReports doesn't like it. I'll see if I can find out whether this has to do with my own code, with JasperReports or with DataStoreServer. If it sounds familiar, then I would appreciate your comments. If not, I may post a new question when I know more about what's happening.

Again, thanks for the solution to the first problem.

Edwin Roestenburg

Edwin Roestenburg

unread,
Jul 14, 2006, 9:31:09 AM7/14/06
to

Thanks Steve,

both options have the desired effect. For now I will stick with the readOnly option, and I will need to figure out why the DataExpress components aren't committing their transactions.

B.t.w. calling Jasper Reports with a ResultSet from the SQL Server has different behaviour from the same call with the same query, but against the DataStoreServer. (The former works always, the latter not). One difference I notice is in the returned columnnames of the ResultSet. In other words, the ResultSets are different, and JasperReports doesn't like it. I'll see if I can find out whether this has to do with my own code, with JasperReports or with DataStoreServer. If it sounds familiar, then I would appreciate your comments. If not, I may post a new question when I know more about what's happening.

Again, thanks for the solution to the first problem.

Edwin Roestenburg

0 new messages