Next Previous Up Contents
Next: Authentication
Up: I/O using SQL databases
Previous: Reading from a Database

#### 3.10.3 Writing to a Database

You can write out a `StarTable` as a new table in an SQL-compatible RDBMS. Note this will require appropriate access privileges and may overwrite any existing table of the same name. The general form of the string which specifies the destination of the table being written is:

        jdbc:<driver-specific-url>#<new-table-name>

Here is an example for MySQL with Connector/J:

        jdbc:mysql://localhost/astro1?user=mbt#newtab

which would write a new table called "newtab" in the MySQL database "astro1" on the local host with the access privileges of user mbt.

Next Previous Up Contents
Next: Authentication
Up: I/O using SQL databases
Previous: Reading from a Database

STIL - Starlink Tables Infrastructure Library
Starlink User Note252
STIL web page: http://www.starlink.ac.uk/stil/
Author email: m.b.taylor@bristol.ac.uk