George,
According to the documentation for 9.1 , lo_export refers to the client making the call. Therefore, if clientA is connected to databaseB when clientA executes your SQL, lo_export should create a file on clientA where you told it.
In light of the fact that you stated that you are using JDBC under MATLAB (I am not familiar with what you can do, and I am not familiar with the interface for making a call), if you call this from a JDBC connection manually:
java.sql.Connection conn= ... java.sql.Statement stmt= conn.createStmt(); java.sql.ResultSet rs= stmt.executeQuery("select data from images where id=0");
I played very fast and fast with JDBC operations for short here. There should be more error checks, as well as try / catch / finally statements for transferring and cleaning connections.
An example of copying files .
source share