Is it normal that if you declare a method on a jFrameView. You can only use few methods from the java.sql package?I'm trying to create a preparedStatement so that I could perform an insert query but I only got these:
Whereas if I use the connection object on a normal command line style java app. I get a bunch of methods available:
They're all under the same folder(package) where the jFrame/Form is. And the package. Please help开发者_开发技巧, I can't understand why its acting this way.
The first conn
is not been declared as java.sql.Connection
. You've declared it as conc
which seems to be some homegrown class. Fix it accordingly. If it is supposed to be some sort of a connection manager, then you should rewrite that class that it has a method which returns a fullworthy java.sql.Connection
so that you can use it further in your code.
This basic tutorial should get you started with approaching JDBC the proper way.
精彩评论