Java
  Home arrow Java arrow Using CSV Files as Databases and Interacti...
IBM Developerworks
CIO Insight
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Download TestComplete 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
eWeek
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Using CSV Files as Databases and Interacting with Them Using Java
By: Kulvir S. Bhogal & Kwang Sik Kang
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 72
    2004-01-28

    Table of Contents:
  • Using CSV Files as Databases and Interacting with Them Using Java
  • Creating an ODBC Data Source
  • Let's Interact

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

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

    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. 

    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).

    More Java Articles
    More By Kulvir S. Bhogal


     

    JAVA ARTICLES

    - 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 ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...

    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway