Search code examples
netbeansdatabase-connectionderby

Error in executing commands in NetBeans with Derby database connection


I installed Apache Derby and successfully created and connected with a derby database on NetBeans. While I was trying to execute commands with NetBeans, I encountered an command error even when my SQL command is correct in syntax. What should I do to fix the problem?

Here's my code: enter image description here

And here's the error message: enter image description here


Solution

  • show databases is not a SQL command, it is an ij command. ij is a command line interpreter for working with Derby databases, and it accepts some extended syntax which is above and beyond SQL itself.

    So you can only give a command like show databases to ij; you can't give it to any general-purpose SQL processing tool, like the Netbeans SQL tool. Those tools only understand SQL proper, not the IJ extensions

    Here's some docs about ij: