Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 15th, 2006, 04:15 PM
Registered User
 
Join Date: Oct 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default JDBC ODBC to ms access problem

Hi , everyone out there , this is preeti , i have problem with jdbc odbc to access ms access i have tried the program with creating DSN name and a table in the access if you see my program below you may get some idea what mistakes i made

import java.sql.*;

class Kokku{


       public static void main(String[]args){


    try {

            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

            String dataSourceName="ashwin";

            String dbURL="jdbc:odbc:"+dataSourceName;

            Connection con =DriverManager.getConnection(dbURL,"","");

          Statement s = con.createStatement();



 s.execute("select column_1 from bd1");


               if(rs!=null)

               while(rs.next())


                 {
System.out.println("Data from column_1 :"+rs.getString(1));

                 }

             s.close();


           con.close();

              }




   catch(Exception e ){

      System.out.println("ERROR :"+err);

              }



}

i have wasted a lot of time for this one can any one help me out

thanks for the pain

preeti






Similar Threads
Thread Thread Starter Forum Replies Last Post
connect jdbc/odbc bridge to ms- sql server 2000 sushant2002 SQL Server 2000 0 July 3rd, 2007 08:28 PM
Problem with fonts in MS Access. Hovhannes Access 1 April 20th, 2007 10:45 AM
Help - Parameters work in ODBC but not in JDBC saf01 Crystal Reports 0 September 15th, 2005 05:02 AM
JDBC-ODBC Bridge and foreign languages (UTF8) TadReeves Java Databases 0 February 25th, 2005 09:40 PM
Access -> Odbc Jdbc Bridge -> Sybase z00mit Java Databases 0 August 25th, 2003 04:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.