public abstract class DBReaderWriter extends AbstractReaderWriter
| Modifier and Type | Field and Description | 
|---|---|
| static String | DBNAMEDatabase name key * | 
| static String | DRIVERCLASSJDBC driver class name key * | 
| static String | DRIVERURLJDBC driver url * | 
| static String | PORTDatabase port key * | 
| static String | SERVERDatabase server key * | 
| static String | TABLENAMETable key * | 
| static String | USERNAMEUser name key * | 
BUILDER, EDGES, GENERATOR, NODES| Constructor and Description | 
|---|
| DBReaderWriter() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Connection | getConnection()Opens a connection to the database, based on set properties. | 
| protected abstract String | getQuery()Template method which returns the query to execute in order to read a graph from the
 database. | 
| Graph | read()Performs a graph read by querying the database and processing each tuple returned in the
 query. | 
| protected abstract Object | readInternal(ResultSet rs)Template method used to create the object represented by a tuple returned by the database
 query. | 
| void | write(Graph g)Performs a write on the graph out to the database. | 
| protected void | writeEdge(Statement st,
         Edge edge)Template method used to write an edge into the database. | 
| protected void | writeNode(Statement st,
         Node node)Template method used to write a node into the database. | 
getProperty, setProperty, setPropertypublic static final String DRIVERCLASS
public static final String DRIVERURL
public static final String SERVER
public static final String PORT
public static final String DBNAME
public static final String USERNAME
public static final String TABLENAME
public Graph read() throws Exception
ExceptionGraphReaderWriter.read()public void write(Graph g) throws Exception
* @see GraphGenerator#write()
g - The graph to beExceptionprotected Connection getConnection() throws Exception
Exceptionprotected void writeNode(Statement st, Node node)
st - Statement used to execute write statement.node - Node to write.protected void writeEdge(Statement st, Edge edge)
st - Statement used to execute write statement.edge - Edge to write.protected abstract String getQuery()
Copyright © 1996–2019 Geotools. All rights reserved.