I need some help about how to connect MS Access database in NetBeans.I visited www.netbeans.org but didnt got much help related to MS Access.

What I did is I start from Net Beans Desktop Application ....But when i select the option of database in it ....It asks Database URL....I have made connection from Control panel>>administrative tool>>Data Source >> and then added Microsft Access Driver(*.mdb) ....and added my database here.....
Like in Net Beans Database URL is written as
jdbcdbc:<DB>
But as i write my data base name here jdbcdbc:Mydatabase.
It gives the following error:
Unable to obtain schema.There is unsufficent information to establish a connection to obtain list of schemas.

I can't Understand what's the problem Please Help :( me

"jdbc:odbc:<DB>" not "jdbcdbc:<DB>"

You also need to configure your DSN (Google for that or ask at a Microsoft forum), and adding the Microsoft Access Driver does no good. Netbeans/Java is not using that, it is an ODBC Driver. Java is using the JDBC-ODBC Bridge which bridges to ODBC Drivers.

Now, all that being siad, if you want a DSNless connection (i.e. you don't want to have to configure a DSN on any system using the app), then do

"jdbc:odbc:Driver={Microsoft Access Driver(*.mdb)};DBQ=<full path to mdb file>;Uid=;Pwd=;"

Edit: The DB Driver (i.e. the JDBC-ODBC Bridge driver) that you do need to configure in Netbeans (instead of the Microsoft ODBC Driver) is "sun.jdbc.odbc.JdbcOdbcDriver"

Thanx it works

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.