Following these instructions is likely to void any warranty on the HP MediaVault.
Following these instructions are highly likely make your HP MediaVault completely and utterly unresponsive and cause loss of data. This is known as "bricking" the MediaVault.
Before proceeding, you should read the prerequisites for Hacking the HP MediaVault here.
If you do not already know SQL then it only takes a few weeks to learn the basics and maybe some 5-20 years to master. So your own SQL database is a good place to learn highly valuable skills.
If you ever learned set-theory in school you will have a good staring point (school systems are different - I was 12-13 years old when it was introduced, but these days some schools will teach it around the age of 7-8).
In a relational database, all information is stored as an un-ordered collection of typed tuples, as defined by a schema. Think of this as a table, where the column headings are named and have a type (characters, integers, etc.); and where each tuple is written as a row in the table.
The SQL language allows you to define these tables, and to select a set of the rows that satisfy a boolean expression that you write. Furthermore, SQL allows you to join information from several tables based on common data.
PostgreSQL is a public domain implementation of an RDBMS. These days, another implementation, MySQL, has gained some popularity over PostgreSQL, particularly for WebHotels, but both have been around for many years and are mature and solid RDBMS implementations.
If you want to access the database on the Media Vault from Windows applications such as MS Excel, then remember to select the ODBC driver in the PostgreSQL installer.
You can find the PostgreSQL documentation here.
Note that if you just want access to the database on the Media Vault, you can log in from a shell (ssh/PuTTY) on the Media Vault using the command:
psql postgres postgresHere, you can browse the tables that support the photo Webshare application.
exec("sudo sudo -u postgres /usr/bin/pg_ctl -o -i -D /usr/postgres/data start > /dev/null 2>&1",$res,$ret);
host all all yourPCsIPAddress/32 trustAlternatively, you could allow all IP addresses in your local subnet (10.0.0.0, 172.16.0.0 or 192.168.0.0 according to the configuration of your router). Be sure you have firewall and virus protection.
psql -h HPMediaVault postgres postgresYou may need to use the IP address instead of HPMediaVault if you get an error message that the host is not know.
To create a mydb user, log in as the existing postgres user and type:
psql -h HPMediaVault postgres postgres create user myself; create database mydb WITH ENCODING 'UTF8' owner myself; \qI have had some problems with the choice of character encoding. If the encoding chosen for your database does not match that of your client software, then you are going to get an error that the proper conversion library under "$lib" does not exist. I have done some experimenting, but have been unable fix this problem. I have the proper library files but this does not make the problem go away.
What I have figured is that for seamless access from the psql tool in a Windows shell, you need ENCODING 'WIN1252', but in order to access the database from Java you need ENCODING 'UTF8'.
I chose ENCODING 'UTF8' for my database. It can still be accessed from psql, but non-ascii characters are not displayed correctly.
Now you can connect and create your own tables without danger of interfering with the Webshare application:
psql -h HPMediaVault mydb myself create table t(a text, b integer); insert into t values('abc', 1);
Open Excel and choose the menu: Data->Import external data->New database query. This opens the "Microsoft Query" application.
In the "Select data source" dialog, choose <New data source>, name the source and select the PostgreSQL driver. Then connect to mydb and choose the table you want to display. You can also connect directly from a an Excel graph to get a graphical representatation of your data, which can be used for statistics, presentations, etc.
As mentioned above, the character encoding must be UTF8 in order for Java to access the PostgreSQL database on the MV.
Next, you must consider where and how Java will be executing:
/usr/jetty-5.1.12/postgresql-8.3-604.jdbc3.jarFor a stand-alone application on the MV, just put this file on your class-path. For a Jetty servlet, you need to copy the file to the WEB-INF/lib directory of your web application.
For Java applications running on Windows, you need some version of the driver .jar file.
You can either download and install from the PostgreSQL site, or you can simply copy the file from the MV to your PCs (just use the Samba-mounted drives).