Class DatabaseConnector
java.lang.Object
net.finmath.smartcontract.valuation.marketdata.database.DatabaseConnector
Class that provides functionalities necessary to get/write data to the market data database.
- Author:
- Luca Bressan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fetchFromDatabase
(List<String> fixingSymbols, String username) Retrieves the latest market quotes and the full fixings history from the database and then writes to the active dataset file.void
init()
Autowiring-compliant constructor.void
Scans the import candidates file and sends a table update request with the new market data.
-
Constructor Details
-
DatabaseConnector
-
-
Method Details
-
init
@PostConstruct public void init()Autowiring-compliant constructor. Credentials file location and temporary file location must be specified in application.yml -
fetchFromDatabase
public void fetchFromDatabase(List<String> fixingSymbols, String username) throws SQLException, IOException Retrieves the latest market quotes and the full fixings history from the database and then writes to the active dataset file.- Parameters:
fixingSymbols
- Symbols which must be treated as fixings and not as quotesusername
- the name of the user that has performed the request- Throws:
SQLException
- when JDBC reports a failure in the DB transactionIOException
- when writing to the active dataset fails
-
updateDatabase
Scans the import candidates file and sends a table update request with the new market data.- Throws:
SQLException
- when JDBC reports a failure in the DB transactionIOException
- if opening the import candidates file was not possible
-