public abstract class DBReaderWriter extends AbstractReaderWriter
Modifier and Type | Field and Description |
---|---|
static String |
DBNAME
Database name key *
|
static String |
DRIVERCLASS
JDBC driver class name key *
|
static String |
DRIVERURL
JDBC driver url *
|
static String |
PORT
Database port key *
|
static String |
SERVER
Database server key *
|
static String |
TABLENAME
Table key *
|
static String |
USERNAME
User 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, setProperty
public 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
Exception
GraphReaderWriter.read()
public void write(Graph g) throws Exception
* @see GraphGenerator#write()
g
- The graph to beException
protected Connection getConnection() throws Exception
Exception
protected 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–2023 Geotools. All rights reserved.