• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Basic Doubt

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a MDB file (Access Database). Can i run the JDBC program, with out Access software in my PC? what are the settings i suppose to do in my PC?
Let me know if i'm unclear.
TIA
with regards
Prakash.M
([email protected])
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should be able to access the MDB through the ODBC driver (as long as the Access DB is registered as an ODBC data source). Performance may be better if there exists an Access driver.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you need example code.
please review this form...
i have added sample code for oracle and ms-access over the past month.
if you can not find sample code.
please reply or send me an email.
i will be happy to post them again.
monty6
 
prakash muthu
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi monty6,
Please let me know the code. Why don't mention your mail id while replying.
with regards
Prakash.M
([email protected])
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As for my email address. I use may computers to access the net.
Each computer uses a different way to access the net.
Becaues of this. I try to keep my email addres private to avoid
junk mail.
Thanks for pointing this out to me. I will include my signature in future posts. Now for the good stuff!
Sample java jdbc code was obtain at Sun's web sight. www.java.sun.com.products.jdbc.book.html
The code that follows. Is one of there sample programs that has
been modified to access a ms-access 2.0 database. So you will have to do the ODBC setup yourself. The ms-access data source name I use is accessDB.
<code>
import java.sql.*;
public class CreateCoffees {
public static void main(String args[]) {
String url = "jdbc:odbc:accessDB";
Connection con;
String createString;
createString = "create table COFFEES " +
"(COF_NAME varchar(32), " +
"SUP_ID int, " +
"PRICE float, " +
"SALES int, " +
"TOTAL int)";
Statement stmt;

try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}

try {
con = DriverManager.getConnection(url, "", "" );

stmt = con.createStatement();
stmt.executeUpdate(createString);
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}
}
}
</code>
Good-Luck...
Hope This Helps
Monty6

------------------
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic