OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

how to reconnect to the database after connection is closed

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
weiqingh
Newbie
Newbie


Joined: 22 Jun 2012
Posts: 4

PostPosted: Fri Jun 22, 2012 5:09 am    Post subject: how to reconnect to the database after connection is closed Reply with quote

hi there,

I have registered a database connection to a mysql server in calc and I can see all the tables in the "Data Sources" view. I was able to drag a table to a cell and display all the rows of that table in the sheet. I can run "refresh range" too.

However, after having the file open for a few days, I got an error trying to access the table from calc: "The data content could not be loaded. No operations allowed after connection closed". I tried to disconnect the database (in the "data source" view) and then double click on it again. but I still got the same error. How do I reconnect to the database?

Thanks,
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Fri Jun 22, 2012 11:53 am    Post subject: Reply with quote

Are you sure that the database is still reachable?
What happens when you restart the office suite (mind the nasty quick-starter)?
You may try connection pooling (Tools>Options>Base>Connections)
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
weiqingh
Newbie
Newbie


Joined: 22 Jun 2012
Posts: 4

PostPosted: Fri Jun 22, 2012 12:20 pm    Post subject: Reply with quote

Thanks for your reply.

Yes I am sure the database is still running -- I could open a mysql client and connect to it. As of now, the only way to get back the database connection is to re-create a brand new database and then link a sheet/cell to it again.

I am also trying to figure out if connection pool would help me. The problem is that when I created the database, I used com.mysql.jdbc.Driver as my driver class ( I specified a classpath pointing to the jar containing that class). but that class is not listed under any of the classes in the conection pool page.

If I tried to use classes listed in the connection pool page to create my database, e.g. org.openoffice.comp.drivers.MySQLDriver or com.sun.star.comp.sdbc.JDBCDriver, I got an error saying the class cannot be loaded correctly.

I am also curious why would connection pool help the problem. there is also a timeout associated with the pool.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Fri Jun 22, 2012 1:54 pm    Post subject: Reply with quote

Forget the connection pooling. Silly me. I have no clue why your connection breaks.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
weiqingh
Newbie
Newbie


Joined: 22 Jun 2012
Posts: 4

PostPosted: Tue Jun 26, 2012 5:29 am    Post subject: Reply with quote

I think the problem might be that I have not saved the password for mysql database. When I created the connection, there is an option to test the connection and I have put my password there and the connection test was successful. But there is no checkbox or any other option to save the password. Did I miss something?
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Tue Jun 26, 2012 5:50 am    Post subject: Reply with quote

Nothing wrong. Whoever tries to connect to your database will be prompted for the password. Of course OOo does not store the password, otherwise a copy of your Base document could be used as access key.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Tue Jun 26, 2012 5:50 am    Post subject: Reply with quote

Nothing wrong. Whoever tries to connect to your database will be prompted for the password. Of course OOo does not store the password, otherwise a copy of your Base document could be used as access key.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
weiqingh
Newbie
Newbie


Joined: 22 Jun 2012
Posts: 4

PostPosted: Tue Jun 26, 2012 5:53 am    Post subject: Reply with quote

Understood. but my point is that given it doesn't save the password, when it tried to re-connect to the database later, I never got a prompt for inputting my password again.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group