Re: getConnection to MS ACCESS problem
From: Leon Bullock (leon_at_bullock1.freeserve.co.uk)
Date: 07/15/04
- Previous message: Daniel Hagen: "Re: get Exported/Imported Keys() doesn't work with JDBC-ODBC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 15 Jul 2004 16:59:17 +0100
"Avraham" <niv444@walla.co.il> wrote in message
news:8b9f0d07.0403300224.2e768c18@posting.google.com...
> Hello,
>
> getConnection problem.
>
> I run this on windows XP. I have MS ACCESS
> database working well.
>
> The problem is with trying to connect to the database (?).
> The database does exist.
Sorry for a late reply, I just joined the group.
Sounds like the ODBC is not set up correctly - this is a quote from the
windows help
=====================
To connect to these data sources, you must do the following:
a.. Install the appropriate ODBC driver on the computer that contains the
data source.
b.. Define a data source name (DSN) by using either the ODBC Data Source
Administrator to store the connection information in the Windows registry or
a DSN file, or a connect string in Visual Basic code to pass the connection
information directly to the ODBC Driver Manager.
=====================
>
> -----------------------------------------
>
> import java.sql.*;
> import sun.jdbc.odbc.*;
>
> public class Test {
> public static void main(String[] args) {
> try{
> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> }catch(java.lang.ClassNotFoundException e){
> System.err.println("ClassNotFoundException: ");
> System.err.println(e.getMessage());
> }
>
> String url="jdbc:odbc:ADDRBOOK";
>
> try{
> Connection con = DriverManager.getConnection(url,"","");
> }catch(SQLException ex){
> System.err.println("SQLException: ");
> System.err.println(ex.getMessage());
> }
> }
> }
>
> -----------------------------------------
> Here is what I get ( ignore the Hebrew characters..I can not read it
> on my XP anyway)
>
> SQLException:
> [Microsoft][ODBC Driver Manager]
> ???? ???° ??·???? ?? ??÷? ??? ÷??? ???? ?·?? ??
> ???? ?°?°· ????
> Press any key to continue...
>
> --------------------------------
> The first "try" does not throw an exception.
> The second "try" does, why ? what should I do ?
>
>
> Please help.
> Thanks, Niv
- Previous message: Daniel Hagen: "Re: get Exported/Imported Keys() doesn't work with JDBC-ODBC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|