[Solved] Script the jdbc java class path for MySQL

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
mwhalen
Posts: 11
Joined: Fri Oct 15, 2010 6:50 pm

[Solved] Script the jdbc java class path for MySQL

Post by mwhalen »

I'm installing OOo3 on my network so users can access a MySQL database I configured with Base. I have a network install solution for OOo, but so far I've had to manually configure the jdbc connector at each desktop to make the connection to MySQL. Is there a way to script this?
Last edited by mwhalen on Thu Dec 02, 2010 5:39 pm, edited 1 time in total.
OOo 3.2 on XP Pro using MySQL on a remote CentOS box
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Is there a way to script the jdbc java class path for My

Post by rudolfo »

The configuration of the class path for Java is stored in the User Profile. For me in %USER_PROFILE_PATH%/config/javasettings_Windows_x86.xml.
You might give it a go and modify this file manually. But I guess that the user profile is not created upon installation, but only after the user started OOo for the first time.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
User avatar
Greengiant224
Posts: 283
Joined: Wed Jun 09, 2010 3:50 pm
Location: All Over The World

Re: Is there a way to script the jdbc java class path for My

Post by Greengiant224 »

rudolfo posted:
The configuration of the class path for Java is stored in the User Profile. For me in %USER_PROFILE_PATH%/config/javasettings_Windows_x86.xml.
You might give it a go and modify this file manually.
The javasettings_Windows_x86.xml is an automatically generated file. It is re-written every time OO.o is opened by a user. So editing it would be useless.

Manually editing each users profile would be very time consuming.
As an idea, and I don't know how PC savvy your users are? You could get them to follow your written instructions. This could cut your work load.

ie:
Fire up openOffice.org Goto >Tools>Options>openoffice>java Make sure use Java JRE is ticked.
Click on Add Classpath button and enter the path to your jar file. Click OK twice. Exit OO.o and the quickstarter.

You have now set up the path to your new jar.

Win 7, Portable AOO 4.1.14, LibreOffice 6.2, 7.4.5 & 7.6.1 (Java 1.7.81 & 1.8.0_281) utilising HSQL 1.8.10 & 2.4.*, MySQL, PostgreSQL, SQLite
+ Blood, Sweat and Tears (Application, Determination and Perseverance)
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Is there a way to script the jdbc java class path for My

Post by rudolfo »

Greengiant224 wrote:The javasettings_Windows_x86.xml is an automatically generated file. It is re-written every time OO.o is opened by a user. So editing it would be useless.
Have you actually tested this? If I look at the javasettings_Windows_x86.xml file in my user profile it gives me a last modification time of April 2010. And I have surely opened and closed OOo since then nearly a hundred times.
It should work in the same way as the prefs.js file in the Mozilla applications: As long as you edit it while the application is not running your changes to the file are persistent. They will be read into the application when it starts and written back into the file when the app closes.

The main problem that i see is that this xml file doesn't exist on the user's computer if OOo is installed as network installation. Actually the complete User Profile is not existing yet.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
User avatar
Greengiant224
Posts: 283
Joined: Wed Jun 09, 2010 3:50 pm
Location: All Over The World

Re: Is there a way to script the jdbc java class path for My

Post by Greengiant224 »

Rudolfo stated:
The main problem that i see is that this xml file doesn't exist on the user's computer if OOo is installed as network installation. Actually the complete User Profile is not existing yet.
If OO.o is installed on a network, you only have to edit ONE javasettings_Windows_x86.xml file.
All users would be able to access the default settings on the networked OO.o setup.
If there are several and maybe hundred/s of users you have a big problem ahead of you editng this said file.
This is the scenario I understood from the original poster.

Win 7, Portable AOO 4.1.14, LibreOffice 6.2, 7.4.5 & 7.6.1 (Java 1.7.81 & 1.8.0_281) utilising HSQL 1.8.10 & 2.4.*, MySQL, PostgreSQL, SQLite
+ Blood, Sweat and Tears (Application, Determination and Perseverance)
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Is there a way to script the jdbc java class path for My

Post by rudolfo »

As far as I know a network install is not really different from a "for all users" installation on a local computer. But instead of having the binary files and the core functionality in the "Program Files" directory they are on a network share. If OOo is started by a logged in user the user profile will be created for this user in the personal settings folder. (Depending on the network setup this personal folder might be located again on a network share of the Domain Controler).
Of course the content of the files in the user profile depend initially on the preset in the common network share. There is "Basis/presets/config" with all those .so[cegh] xml files and also "Basis/share/config", but I can't find any javasettings_Windows_x86.xml file there. There is a javasettingsunopkginstall.xml that uses the same XML namespace "http://openoffice.org/2004/java/framework/1.0" as the generated file.
Not sure, if you can add some presets in this file that will then be used in all generated javasettings_Windows_x86.xml. I see some complicated encoded byte sequence in the "vendorData" tags. Looks like a checksum. If the data inside this tag is not documented anywhere (except for the source code) it will be nearly impossible to preset this in the correct way. The JRE seems to depend on this sequence.
At the end you'll have to define the class path without a working JRE. This might be possible ... or it is not possible. Could also be that the Classpath in the user profile that is copied from the central place is wiped out again if OOo searches for a JRE on the local computer.
I stop guessing now ... there is an admin guide on the documentation wiki. That guide is supposed to know better then me.
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
mwhalen
Posts: 11
Joined: Fri Oct 15, 2010 6:50 pm

Re: Is there a way to script the jdbc java class path for My

Post by mwhalen »

I should have been more specific. I'm installing it on the majority of the desktops in our network using the silent install and batch scripts. I'd like to automate the class path to avoid going to each desktop. I'd also like to avoid hoping that users can follow my written instructions. I could use a logon script to copy the proper xml file into that path if that might work. Looks like I'll have to experiment.
OOo 3.2 on XP Pro using MySQL on a remote CentOS box
mwhalen
Posts: 11
Joined: Fri Oct 15, 2010 6:50 pm

Re: Is there a way to script the jdbc java class path for My

Post by mwhalen »

Well, I had to relocate the connector to a path that would be common to all the desktops (not a username path) but I verified the path to the xml file can be created and the file added prior to first run and it works. Thanks.
OOo 3.2 on XP Pro using MySQL on a remote CentOS box
Post Reply