when using only one database / without prefixing table names
URL jdbc:mysql://localhost:3306/dbname
Preference: menu/tools/preferences/query builder: don't use schema name in syntax definition
generated syntax: select ... from tablename
when using many databases / prefixing table names with db name
URL: jdbc:mysql://localhost:3306
Preference: menu/tools/preferences/query builder: use schema name in syntax definition
generated syntax: select ... from dbname.tablename
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Technical questions" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hello,
I just started to use SQLeo, and I like it very much.
I have a question when I copy an existing query, and paste it into the syntax-tab.
When I want to run the query, I get the error:
java.sql.SQLException: No database selected
How can I select de database, because I opened and selected the correct database.
I use MySQL (MariaDB Jdbc Driver)
Thanks,
Marc
Hello,
with this driver if you don't specify the database in the URL like
jdbc:mysql://localhost:3306
then you have to préfix your table name with the schema or database name like:
select MyTableAlias.blabla from MyDatabaseName.MyTable as MyTableAlias
or to specifiy the database before to launch the select with syntax
use MyDatabaseName
Regards
PAscal
Last edit: PAscal 2016-02-10
to clarify MySQL set up:
when using only one database / without prefixing table names
URL jdbc:mysql://localhost:3306/dbname
Preference: menu/tools/preferences/query builder: don't use schema name in syntax definition
generated syntax: select ... from tablename
when using many databases / prefixing table names with db name
URL: jdbc:mysql://localhost:3306
Preference: menu/tools/preferences/query builder: use schema name in syntax definition
generated syntax: select ... from dbname.tablename