JDBC Connection Example
This demo illustrates how one can use JDBC in conjunction with the JMSL TM Library. This example uses the JDBC-ODBC bridge and so only runs on the Windows platform. Code beyond the connection could be used with any JDBC connection method on other platforms, however. For more information about JDBC consult java.sun.com
To run the demo, the included MS Access database xau.mdb must first be registered in the ODBC Manager. This can be done following these steps:
- Open Control Panel -> Administrative Tools -> Data Sources (ODBC)
- Click "Add...", select Microsoft Access Driver (*.mdb), Click "Finish"
- Type "xau" (no quotes) in the Data Source Name field. Add a description if you wish.
- Click "Select..." and browse to the xau.mdb file included in SampleJDBC. Click "OK"
- That's all. Close the ODBC Data Source Administrator by clicking "OK"
The table contains 6 columns: index, date, open, high, low, close. The first column is an int, the second a date, and the rest are doubles.You should see some output in the console as the result of the query is parsed. A Candlestick chart of the results of the query is plotted. Note that only 50 rows are read of the over 3000 in the table.
The chart is created using the JMSL Library class com.imsl.chart.Candlestick.