Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 15th, 2006, 04:15 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
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

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.