问题
I'm a beginner so I might be missing something, but when I create a new derby database in netbeans on windows, if I specify username and password, a schema with the same name of the username is created, but when I create database with username in netbeans on mac osx, no schema is created, the database has just the default schemas, app, nullid etc, is this a bug or is there a setting for this behavior? both netbeans and derby are newest version. thanks.
回答1:
I think you're just misreading the behavior. The behavior on Windows and Mac is identical. Derby implicitly creates a schema named with the username on-the-fly. But you can explicitly reference schemas too, by fully-qualifying table names, etc., by using the CREATE SCHEMA statement, etc. You are probably just not using the username that you think you are, or you are not looking at the same database that you think you, or something like that.
Try making your question more concrete by posting exact scripts of what you're doing, e.g., using the 'ij' tool on both machines, so we can see what you might be doing differently. I routinely use Derby across Windows, Mac, and Linux, and I've always found the username/schemaname handling to be consistent.
来源:https://stackoverflow.com/questions/9546556/netbeans-derby-no-username-schema-created-in-new-database-on-mac