2

How can csv be used as a read-only database without a JDBC-ODBC bridge in java 8?

I am getting this error:

java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
Poonam Adhav
  • 382
  • 3
  • 10
  • How do you use your datasource? Only as read-only database? – Flown Aug 23 '18 at 11:21
  • 1
    See here for some suggestions: https://stackoverflow.com/q/14229072 –  Aug 23 '18 at 11:29
  • Reformatted to make your question easier to read. Still, your input is pretty unclear. CSV is nothing but a file format, and it isn't really related to databases. Whereas the exception you have here points to a missing database driver. Thus: please read [mcve] and further enhance your question. – GhostCat Aug 23 '18 at 11:30
  • @Flown yes only as read-only database – Poonam Adhav Aug 23 '18 at 12:29
  • 1
    Then have a look at: http://csvjdbc.sourceforge.net/ – Flown Aug 23 '18 at 12:39
  • 3rd party JDBC-ODBC bridge: [cdata.com/drivers/bridge/jdbc/](https://www.cdata.com/drivers/bridge/jdbc/) and 3rd party JDBC Driver for CSV: [cdata.com/drivers/csv/jdbc](https://www.cdata.com/drivers/csv/jdbc). _Full Disclosure: my employer_ – Jerod Johnson Aug 23 '18 at 13:35

1 Answers1

0

You could use a database such as h2 to load the CSV file as a table or directly read using its utilities. Look into http://h2database.com/html/tutorial.html#csv

chandra
  • 500
  • 4
  • 12