this is what i have... Connection conn = null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn = DriverManager.getConnection("jdbc.odbc:josh"); System.out.println("connection = " + conn); --------------------------- conn comes back null, i'm not sure if this part of my code is correct... ("jdbc.odbc:josh"); where josh is the name of my Access database. thanks for any help!
i have the DSN set up, i'm concerned that this part of my code is incorrect... conn = DriverManager.getConnection("jdbc.odbc:josh"); i'm not sure if i should use the DB name(josh) here, or if i should insert something else there?
Hello Josh, the syntax is DriverManager.getConnection("jdbcdbcBName","user","password"); Where DBName is your database name, not the table name. If you didn't set a user and a password, try with empty quotes (just a guess). And check that your DSN is correctly set. Hope it helps [edited to remove the smilies] [ January 23, 2003: Message edited by: Younes Essouabni ]
By constantly trying one ends up succeeding. Thus: the more one fails the more one has a chance to succeed.
Josh, I gave you the code in the other thread it is as follows:
It is important that the DSN entry must have the same case as the url assignment. So, here it would be Josh. My suggestion would be to use all upper or all lower case. The DSN entry contains all of the information about you DB, where it is and its name. The connection that you create in your Java program is connecting to the DSN entry that has the location and name information. If you want to see if the connection was successful try this:
[ January 24, 2003: Message edited by: Sam Moran ] [ January 24, 2003: Message edited by: Sam Moran ] [ January 24, 2003: Message edited by: Sam Moran ] [ January 24, 2003: Message edited by: Sam Moran ]
We make a living by what we get, we make a life by what we give!