Coder's Guild Mailing List

Re: Java and Access

Posted by AmNeSiA on 2000-03-16

> > Is MS Access a viable database solution for use with
> > Java? I am going to be doing a fairly large database
> > and java+swing front end, Access is all I have at the
> > moment. This will be developed for my job and we use
> > MS Windows NT Server and Workstation and 98 to connect
> > to our server. We plan on getting MS SQL Server but
> > all I have at the moment to get us started is Access.
> I think Access has an ODBC interface, so you should be able to use a
> JDBC/ODBC bridge. (From what I've heard and read... I haven't tried it
> myself).
>
> I haven't looked at this link, but maybe its of help:
> http://networkcomputing.com/netdesign/odbc3.html
>
> I don't know anything about your reporting problem, but here's a link to a
> commercial Java reporting package:
> http://www.enterprisesoft.com/
>
> Sorry if I wasn't any help.

/*
 * @(#)Database.java 0.2 2000/01/19
 *
 * $ Id: DatabaseEngine.java,v 0.2 2000/01/19 13:15:47 eugene Exp $
 * $ Author: eugene $
 * $ Email: eugeneteo@xxxxxxxxx.xxx $
 *
 * 2000/01/20 Added comments on how to use the Oracle JDBC Driver
 */

package com.jsecure.sql;

import java.sql.*;

>.....

    try{
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    }catch(ClassNotFoundException cnfex){
      System.err.println("Failed to load JDBC/ODBC driver.");
      cnfex.printStackTrace();
      System.exit(1);
    }

  /**
   * In your program, do these:
   *
   * try{
   *  Connection conn = Database.getConnection();
   *  Statement stmt = conn.CreateStatement();
   *  ResultSet resultSet = stmt.executeQuery(query);
   * }catch(SQLException sqlex){
   *  sqlex.printStackTrace();
   * }
   */
  public static Connection getConnection()
  {
    try{
      return DriverManager.getConnection(_oURI, _oUserID, _oPassword);
    }catch(SQLException sqlex){
      System.err.println("Unable to connect");
      sqlex.printStackTrace();
      System.exit(1);
    }
    return null;
  }

>.....

Hope this is useful for u. credit me haha. kidding...

Btw, in Java 2, it is possible to print ;) But then again, Too much Java
isn't
healthy. oh no, there i go again, Love-Hate Java. I HATE JAVA ;)
--
Eugene Teo - http://eugeneteo.net - http://elinux.cx
Email: eugeneteo@xxxxxxxxx.xxx, eugeneteo@xxxxxx.xx


Sponsored by Wrox Press - www.wrox.com. Programmer to Programmer (TM)
To signoff send a mail to listserver@xxxx.xx.xx with 
  "signoff tcg" in the body of your message.