Well, the text of the command is just that - the text. It is a String literal. It cannot ever be null. That it is also is a SQL command to be used with PreparedStatement is irrelevant. I don't see how System.out.println("some String literal") could ever throw a NPE (NullPointerException).
So I'd say that the NPE comes from a different line in your program. You can easily try that - just comment out the System.out.println and try again. My bet is that the error will be exactly the same - even the line numbers in the stack trace won't change.
You should be able to identify the exact line where the exception occurred from the stack trace.