Advanced: Local DB
By default, the Remote menu connects to a remote server. The Advanced menu provides a Local DB option that allows you to connect directly to a database on your local machine or LAN and emulate a remote server for database operations. This does not support file transfers.
To use this you must have a JDBC driver in your classpath that is able to connect with your database. If you run DataView with an embedded JRE put the driver .jar file in the jre/lib/ext directory and it will be included in your classpath. If you run DataView with an external JRE you need to modify your startup script dv.sh (Unix) or dv.bat (Windows) to add the .jar file to your classpath.
The Local DB menu item is a checkbox. When you turn it on a dialog box will open and prompt you to load a *.pool file that provides connection parameters for the JDBC driver in your classpath. Don't confuse this with a DataView application user. Here's an exammple for the MySQL driver:
pool=dbname driver=org.gjt.mm.mysql.Driver ping=select 1 host=jdbc:mysql://hostname_or_IPaddr:3306/dbname user=dbuser password=an8chpwd
You must tell the MySQL server to grant access to this conneciton. You can do this from the MySQL client in console mode.
[jdoe@somehost]$ mysql -u root -p Enter password: ******** mysql> use mysql; mysql> grant select, insert, update, delete on dbname.* to dbuser@hostname_or_IPaddr identified by 'an8chpwd'; mysql> flush privileges; mysql> exit
NOTE: MySQL must be able to resolve the hostname to an IP address. I have encountered problems with this when the database is on my local machine, particularly when trying to connect from a servlet runner. Using the IP address of the local machine rather than the host name usually takes care of it.
If you download a table from a local database and save it as a DataView .tbl file remember that it should only Merge or Update with the original database it came from. If you try to do that with a different database server your DataView table will have primary keys and timestamps that don't match and you will encounter errors.