java.lang.Object
org.neo4j.jdbc.Neo4jDataSource
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
,Neo4jDataSourceExtensions
A Neo4j specific extension of
DataSource
. It may be referred to for use with
unwrap(Class)
to access specific Neo4j functionality.- Since:
- 6.0.0
- Author:
- Michael J. Simons
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newDataSource
which is not yet usable without further configuration. -
Method Summary
Modifier and TypeMethodDescriptiongetConnection
(String username, String password) Returns the name of the database to use.int
Returns the password for the user that connects to the database.int
Returns the port number.Returns the server name or IP address to connect against.Returns the transport protocol.getUser()
Returns the user that should be connected to the database.boolean
isWrapperFor
(Class<?> iface) void
setConnectionProperty
(String name, String value) Sets a connection property on the data source.void
setDatabaseName
(String databaseName) Configures the database to use.void
setLoginTimeout
(int seconds) void
setLogWriter
(PrintWriter out) void
setPassword
(String password) Configures the password to use.void
setPortNumber
(int portNumber) Configures the port number to use.void
setServerName
(String serverName) Configures the server name or IP address to connect against.void
setTransportProtocol
(String transportProtocol) Configures the transport protocol, might be null or empty, s or ssc.void
Configures the user that should be connected to the database.<T> T
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
Constructor Details
-
Neo4jDataSource
public Neo4jDataSource()Creates a newDataSource
which is not yet usable without further configuration. This constructor is mainly used for tooling that loads data sources via reflection.
-
-
Method Details
-
getDatabaseName
Description copied from interface:Neo4jDataSourceExtensions
Returns the name of the database to use.- Specified by:
getDatabaseName
in interfaceNeo4jDataSourceExtensions
- Returns:
- the name of the database to use
-
setDatabaseName
Description copied from interface:Neo4jDataSourceExtensions
Configures the database to use.- Specified by:
setDatabaseName
in interfaceNeo4jDataSourceExtensions
- Parameters:
databaseName
- a database name
-
getPassword
Description copied from interface:Neo4jDataSourceExtensions
Returns the password for the user that connects to the database.- Specified by:
getPassword
in interfaceNeo4jDataSourceExtensions
- Returns:
- the password for the user that connects to the database
-
setPassword
Description copied from interface:Neo4jDataSourceExtensions
Configures the password to use.- Specified by:
setPassword
in interfaceNeo4jDataSourceExtensions
- Parameters:
password
- a password
-
getPortNumber
public int getPortNumber()Description copied from interface:Neo4jDataSourceExtensions
Returns the port number.- Specified by:
getPortNumber
in interfaceNeo4jDataSourceExtensions
- Returns:
- the port number
-
setPortNumber
public void setPortNumber(int portNumber) Description copied from interface:Neo4jDataSourceExtensions
Configures the port number to use.- Specified by:
setPortNumber
in interfaceNeo4jDataSourceExtensions
- Parameters:
portNumber
- the new port number
-
getServerName
Description copied from interface:Neo4jDataSourceExtensions
Returns the server name or IP address to connect against.- Specified by:
getServerName
in interfaceNeo4jDataSourceExtensions
- Returns:
- the server name
-
setServerName
Description copied from interface:Neo4jDataSourceExtensions
Configures the server name or IP address to connect against.- Specified by:
setServerName
in interfaceNeo4jDataSourceExtensions
- Parameters:
serverName
- the new server name
-
getUser
Description copied from interface:Neo4jDataSourceExtensions
Returns the user that should be connected to the database.- Specified by:
getUser
in interfaceNeo4jDataSourceExtensions
- Returns:
- the user
-
setUser
Description copied from interface:Neo4jDataSourceExtensions
Configures the user that should be connected to the database.- Specified by:
setUser
in interfaceNeo4jDataSourceExtensions
- Parameters:
user
- the new user
-
getTransportProtocol
Description copied from interface:Neo4jDataSourceExtensions
Returns the transport protocol.- Specified by:
getTransportProtocol
in interfaceNeo4jDataSourceExtensions
- Returns:
- the transport protocol
-
setTransportProtocol
Description copied from interface:Neo4jDataSourceExtensions
Configures the transport protocol, might be null or empty, s or ssc.- Specified by:
setTransportProtocol
in interfaceNeo4jDataSourceExtensions
- Parameters:
transportProtocol
- the new protocol
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getConnection
- Specified by:
getConnection
in interfaceDataSource
- Throws:
SQLException
-
getLogWriter
- Specified by:
getLogWriter
in interfaceCommonDataSource
- Specified by:
getLogWriter
in interfaceDataSource
-
setLogWriter
- Specified by:
setLogWriter
in interfaceCommonDataSource
- Specified by:
setLogWriter
in interfaceDataSource
-
setLoginTimeout
public void setLoginTimeout(int seconds) - Specified by:
setLoginTimeout
in interfaceCommonDataSource
- Specified by:
setLoginTimeout
in interfaceDataSource
-
getLoginTimeout
public int getLoginTimeout()- Specified by:
getLoginTimeout
in interfaceCommonDataSource
- Specified by:
getLoginTimeout
in interfaceDataSource
-
getParentLogger
- Specified by:
getParentLogger
in interfaceCommonDataSource
-
unwrap
- Specified by:
unwrap
in interfaceWrapper
- Throws:
SQLException
-
isWrapperFor
- Specified by:
isWrapperFor
in interfaceWrapper
- Throws:
SQLException
-
setConnectionProperty
Description copied from interface:Neo4jDataSourceExtensions
Sets a connection property on the data source.- Specified by:
setConnectionProperty
in interfaceNeo4jDataSourceExtensions
- Parameters:
name
- the name of the connection property to be setvalue
- the value of the connection property to be set
-