Home arrow Java arrow Using CSV Files as Databases and Interacting with Them Using Java
JAVA

Using CSV Files as Databases and Interacting with Them Using Java


In this article, we’ll show the reader how to use a simple CSV (comma-separated values) file as a simplistic database setup.  We will leverage the JDBC-ODBC to interact with a CSV file, reading and writing to it with SQL.  Such a technique can be particularly useful for someone trying to write simple database code, but not able to because a local database instance is not pragmatic. 

Author Info:
By: Kulvir S. Bhogal & Kwang Sik Kang
Rating: 4 stars4 stars4 stars4 stars4 stars / 86
January 28, 2004
TABLE OF CONTENTS:
  1. · Using CSV Files as Databases and Interacting with Them Using Java
  2. · Creating an ODBC Data Source
  3. · Let's Interact

print this article
SEARCH DEVARTICLES

Using CSV Files as Databases and Interacting with Them Using Java
(Page 1 of 3 )

Enter Stage Left… Our Text File/Database

To keep things simple, we will have a text file that associates a state name with its state bird (See Figure 1).  Download the file from the project download section

CSV
Figure 1: Structure of statebirds.txt

Pay particular attention to the first row defining the names of our columns, State and StateBird. Each line defines a separate database record. Also note each field of each record is surrounded by double quote marks. Lastly, commas are used to separate the fields of records from one another (ergo comma-separated values).


blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials