This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | No tables displayed when connecting to MS Access using the JDBC-ODBC driver | ||
---|---|---|---|
Product: | db | Reporter: | hsalameh <hsalameh> |
Component: | Code | Assignee: | David Vancouvering <davidvc> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | Marek.Sestak |
Priority: | P3 | Keywords: | NETFIX |
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 66787 | ||
Attachments: |
Stack trace
Screenshot of working state potential patch (only compile tested - needs a real test!) |
Description
hsalameh
2006-04-27 05:38:11 UTC
Which error message did you get? I can connect with the following database URL: jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\NetBeans\\db1.mdb but I get an error message that the schemas could not be retrieved. That seems to be caused by the bridge or the driver, which results in a SQLException when DatabaseMetaData.getSchemas() is called. But I can press OK in that dialog and the new connection is added to the Runtime tab. That is true. The connection is established, but i cannot see any tables in the "Tables" node. As you explained, it DatabaseMetaData.getSchemas() is throwing an exception (optional feature not implemented). But I was evaluating MyEclipse sometime in the past, and I used the same driver (Sun's JDBC-ODBC bridge) and the same connection string, and MyEclipse db explorer was able to read the database structure and display the tables correctly. My goal here is to get MSAccess to work with JPA in a webapp (to get the "entities from database wizard" work with msaccess. Reopening then. An exception (see attachment) is thrown when expanding the Tables node, but it is not thrown in a simple JDBC program which just connects to the database and does conn.getMetaData().getTables(null, null, "%", new String[] { "TABLE" }). We're probably doing something the driver doesn't like. Created attachment 33883 [details]
Stack trace
I've had the same problem connecting to Access from the Netbeans 6 preview (M9). Tried again using version 5.1.1. with the JDK 6, second update. The problem is still there. When connecting using the db wizard, I get I dialog box saying that "There is insufficient information to establish a connection to obtain a list of schemas. Check database url, user and password. Driver message:[Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented". Still, when I hit OK, the connection is established. When I try to explore the database, I dialog box tells me "Unable to read the database structure, connection is broken;[Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented". *** Issue 66787 has been marked as a duplicate of this issue. *** Note, that JDBC-ODBC Bridge will be enhanced --> https://jdbc-odbc-enhanced.dev.java.net/ Have you ever tried it's milestones ? yes, we're calling "getDatabaseProductName" and I suspect Access doesn't support it. We should catch the exception and handle it correctly rather than bailing. I'm making a change that I am pretty confident will work: I bascically handle any exception that can come from querying metadata. Once I mark this as fixed (which means the change has been integrated into the main codeline), can one of you using Access please verify? I don't have Access set up, and trying to do so would make it impossible for me to get this fix in in time for code freeze... Thanks! Hi to all , I had the same problem using Netbeans IDE 6.1-6.5 if you are try to connect JDBC-ODBC using MSAcces inside the IDE it fails. But if you going to use Java Main Class and put some sample code in JDBC-ODBC it works perfectly and I feel this will work only on Java Desktop Application, I have no idea if I can pool this code in Visual Web JSF in any Palette Component. If you have any ideas pertaining JDBC-ODBC using MS Access on Visual WEb JSF much appriciated. Many thanks. The issue still exists in netbeans 7.x.x (tried on 7.0.1, 7.1.2, 7.2.1) Also when a connection pool is created using glassfish admin console, the pool gets created (i.e. you can ping successfully)but when you try to create an entity from database, no schema or tables show up in the dialog. Please suggest how can we use 'Create Entity from database' option in cojunction with MS Access connection pool & jdbc data source. *** Bug 180624 has been marked as a duplicate of this bug. *** Created attachment 130423 [details] Screenshot of working state I tested on windows 2003 server - the zip database from here: http://databases.about.com/od/access/a/zipcodedatabase.htm Downloaded the Microsoft Access Database Engine 2010 Redistributable and installed it. I created a System-DSN pointing to the .mdb Databasefile (called xxy in the screenshot). This works. Netbeans 7.2.1, Oracle JRE 7u11 Closing as the first entry from this bug also works (adapted for my paths). For the entities from database action - I suspect a generic problem. If I recall correctly this is already discussed and being worked on. Reopened as the entity generation problem is really odbc/access specific. It's caused in DriverSpecification.java - I only checked getTables and getProcedures, but I suspect any method on DatabaseMetaData (DMD) taking a schema information is affected. If you query the DMD like this: rs = dmd.getTables(catalog, schema, tableNamePattern, types); you'll get an error if schema != null. The error states that quering with a schema is an optional feature and not supported by access. There is already a hack in DriverSpecification for drivers not supporting handling of non-null catalogs - the attached patch translates that to the schema handling. Created attachment 130425 [details]
potential patch (only compile tested - needs a real test!)
Thank you very much for the patch, Matthias! It seems fine and works correctly. I've added some tests as you'd suggested. Integrated as http://hg.netbeans.org/core-main/rev/aa71fae0e5db Integrated into 'main-golden', will be available in build *201302122300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/aa71fae0e5db User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #75595: No tables displayed when connecting to MS Access using the JDBC-ODBC driver |