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.
DatabaseConnection should have methods to get database metadata such as tables, views and procedures. This will be useful for other modules that do not want to use DatabaseConnection for display purpose. (like in Hibernate module). The new methods can be in the same line as of getSchema() that exists today.
Can't you just use getJDBCConnection() to get the JDBC connection and then call connection.getMetaData()? See http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html#getMetaData() and http://java.sun.com/j2se/1.5.0/docs/api/java/sql/DatabaseMetaData.html
Yes, I can. But I was expecting that Database Explorer providing that data, since it already has that capability in creating Database Node (under Services window) and it wraps the database connection creation. Why can't we just extend this and make Database Explorer API powerful ?
Such methods do not belong on DatabaseConnection. But it is true we desperately need support in the IDE to extract database metadata: - module writers don't want to deal with DatabaseMetaData themselves, - module writers shouldn't need to devise a way to cache the metadata, - we don't want multiple modules to extract the metadata, as that impacts performance. Actually, there is already an issue for introducing a database model, so perhaps this issue should be closed as a duplicate.
Hi, Andrei. For my edification, can you provide some data behind "desperately need?" Who needs it, and in order to support what features, and do you have a sense of how important those features are? If I'm to do this kind of work as well as the kind of stuff I need to do to improve MySQL support, then I may desparately need some help :)
I can think of at least the following places in NetBeans that needs to retrieve database metadata: - DB Explorer - visual web editor - JPA Entity Classes from Database wizard - Hibernate support Currently these components use their own way of retrieving and caching the database metadata. This impacts performance, since metadata are retrieved multiple times (and for network connections, they may be not cheap to retrieve) and they are kept in memory multiple times. In the future, we might also need retrieving metadata for - code completion of database metadata in JPA annotations - SQL editor code completion
We're going to start working on this, marking it as a duplicate of the one Andrei is using to track this. *** This issue has been marked as a duplicate of 133989 ***