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.
In a connection with a mysql db, the tables with a - in the name are not shown in the db explorer.Perhaps a back-tick ` issue ?
bartvdc, could you please add a create table statement/script which create such problematic table? I need more information to reproduce the problem and realize what's wrong. Thanks
fi : CREATE TABLE `invisible-table` (id INT); I didn't try this one out, but so you get the idea. I've got some db where I can see all tables exept those with the - in the name.
It works for me in NB6.8M2. When I ran --- create table `table-invisible` (id varchar(8)) --- and then call Refresh on Tables node. The 'invisible' table was there.
I've tried it in 6.7.1 and it doesn't work. What's the difference between the versions? Can't we get a patch on 6.7.1 ?
I just tried it with 6.8M2, it doesn't work. I can't see the tables. In the screen shot on the right a view in phpadmin, left NB 6.8M2.
Created attachment 89760 [details] screenshot
The problem does not appear with every mysql server. I only get it with a mysql server installed on windows server 2003. even with one installed on winxp it works. The same problem occurs in SQLYog and SQL-Workbench, but in phpadmin and the mysql gui tools it works. The problem has to be a mismatch between a setting of my mysql server and the jdbc driver.
Posted on mysql forum : http://forums.mysql.com/read.php?10,288652,288652#msg-288652
The sql command "show tables" shows all tables. How does NB gets the tables in the db explorer view ?
Created attachment 90661 [details] screenshot show tables
The IDE gets tables through JDBC driver. If the code below (customized for your connection and with driver jar on classpath), doesn't show all tables then something is wrong with your driver or MySQL installation. Class.forName("com.mysql.jdbc.Driver"); Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", null); ResultSet tablesRS = connection.getMetaData().getTables(null, null, "%", new String[] { "TABLE", "SYSTEM TABLE" }); while (tablesRS.next()) { System.out.println("TABLE_NAME=" + tablesRS.getObject("TABLE_NAME")); }
When I add this : System.out.println("****************"); Statement statement = connection.createStatement(); java.sql.ResultSet resultSet = statement.executeQuery("SHOW TABLES"); while (resultSet.next()) { System.out.println("SHOW TABLE= " + resultSet.getObject("Tables_in_minusdb")); } The output is TABLE_NAME=t_with_underscore **************** SHOW TABLE= t-with-minus SHOW TABLE= t_with_underscore With show tables the table is shown, not with "connection.getMetaData().getTables()" I'll add the info in the mysql forum. Bart