Using Derby DB on Windows. Java program creates database under C:/DerbyDBs.
$ /c/DerbyDBs
$ ls
derby.log gradesDB/
The Java program created a number of tables as shown by this test program:
$ java cit111.instructor.DatabaseDriver
Select database task by number:
1. Create database and table
...
10. Show table names
99. Exit
10
Tables currently in the database
FA19POINTS
GRADES
SP20POINTS
If I use 'ij' to access the database it can't see these tables:
$ /c/DerbyDBs
$ java org.apache.derby.tools.ij
ij version 10.14
ij> connect 'jdbc:derby:gradesDB';
ij> select * from grades;
ERROR 42X05: Table/View 'GRADES' does not exist.
If I create a table using 'ij', the Java program does see the new table, and of course 'ij' will successfully query its new table:
$ /c/DerbyDBs
$ java org.apache.derby.tools.ij
ij version 10.14
ij> connect 'jdbc:derby:GradesDB';
ij> create table moregrades(test varchar(10));
0 rows inserted/updated/deleted
ij> select * from moregrades;
TEST
----------
0 rows selected
----------------------------------------------------
$ java cit111.instructor.DatabaseDriver
Select database task by number:
1. Create database and table
...
10. Show table names
99. Exit
10
Tables currently in the database
MOREGRADES
FA19POINTS
GRADES
SP20POINTS
One the one hand I might suppose I'm not actually connecting to the same database, but as the Java program sees what the command line interface creates, that doesn't appear to be the case. So then is there some sort of permissions mismatch, or a property setting that's different? Rather puzzling...
--- Update ---
There was a missing property, the username and password.
ij> connect 'jdbc:derby:gradesDB;user=user1;password=user1';