Hi,

Am Freitag, den 11.12.2020, 15:07 +0000 schrieb Kenneth Fogel:
> Every submission has SQL scripts that I must run before I can run the
> student code. Randomly, without a pattern I can detect, the SQL
> scripts run with errors claiming a table is missing. When this
> happens I just run the script that creates the database and the
> second script that creates the tables and inserts test data. The
> problem escalates when suddenly these scripts won’t run without
> errors claiming that the database does not exist as well as more
> missing tables. I go to the Services tab, open the root connection to
> the MySQL DB and I see the db and tables. If I run a script with just
> “drop database xxxx;” it tells me the script ran fine but when I look
> it is still there. At one point I resorted to running the scripts in
> MySQL Admin and they worked fine. The student code using JDBC runs
> without any of these problems especially as part of the unit tests
> they have a routine that runs the create tables script.

there are two very different things here and this is:

SQL Execution vs. Database Explorer View

The SQL execution from the editor does only very limited black magic.
The SQL script is parsed and split into it's individual statements,
comments are stripped and then the execution is handed of to the jdbc
driver. I don't see how that should cause random errors. If an SQL
fails you get error output in the output window, more info might be
available in the netbeans log.

The Database Explorer View is an altogether different beast. In the SQL
editor some detection for DDL scripts present, that triggers updates of
the view, but that can't be perfect. If you change the DB structure and
want a current view, you need to manually refresh the view. A
corresponding menu entry is present in the DB nodes on different
levels.

Contrary to other believes, fetching DB structure is not cheap
operation. If you have a trivial database (10-100 tables) and the DB is
local, all looks easy, once your database becomes more complext 1000+
tables and behind a WAN link, the fun ends. In the past I tried to have
a look at a SAP database. It literally killed my session. So polling DB
structure is a no-go.

Greetings

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to