Author | Message |
---|---|
lishenyu
Posts: 103
|
Posted 23:03 Nov 09, 2015 |
Hi Dr.Sun, I have deleted the previous project and re-import SimpleDB project , but when I run it and no matter what query I typed , it still gave me NullPointerException : SQL Exception: java.lang.NullPointerException could you help me solve this ?Thanks! |
cysun
Posts: 2935
|
Posted 08:26 Nov 10, 2015 |
Did you create any table before trying to "select"? |
lishenyu
Posts: 103
|
Posted 09:52 Nov 10, 2015 |
I just start the server first then run the client , and in console it prompts to ask for SQL> ,then I type easy query like "select id from students; " then this nullpointerexception occurs |
cysun
Posts: 2935
|
Posted 09:55 Nov 10, 2015 |
Sounds like you didn't create a students table or the students table didn't have a column id. |
lishenyu
Posts: 103
|
Posted 10:11 Nov 10, 2015 |
isn't it that when we run the client ,it automaticly creates a student DB? I need to create student DB? but yesterday I didn't create any tables , at first it can run the basic query but then for some reason ,it results in this exception. |
lishenyu
Posts: 103
|
Posted 10:14 Nov 10, 2015 |
because I have seen code of CreateStudentDB in same folder in Client folder , so I think ,when we specify no arguments ,it will automatically create a StudentDB. |
cysun
Posts: 2935
|
Posted 10:27 Nov 10, 2015 |
When you run the server, if no database exists, it will create an empty StudentDB. There are several client programs. Read the code to see what each client does. |