Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
PreparedStatement error
shaf maff
Ranch Hand
Posts: 180
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi Guys
The compiler keeps giving me an error about my preparedstatment, I have spent to laast 15/20min trying to workout exactly what went wrong to no avail. Hopefuly someone here will beable to point me in the right direction:
PreparedStatement preparedStatement = null;
preparedStatement = connection.preparedStatement(SQL_CREATE_NEW_MAIL);
MailDAO.java:99: cannot find symbol symbol : method preparedStatement(java.lang.String) location: interface java.sql.Connection preparedStatement = connection.preparedStatement(SQL_CREATE_NEW_LETTER); ^
java.lang.NoClassDefFoundError: dao/MailDAO Caused by: java.lang.ClassNotFoundException: dao.MailDAO at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
shaf maff
Ranch Hand
Posts: 180
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Ah, I fixed it. It should have been:
connection.
prepareStatement
(SQL_CREATE_NEW_MAIL);
Bauke Scholtz
Ranch Hand
Posts: 2458
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Glad you fixed it.
For what it´s worth, using an
IDE
and reading the API docs would have helped a lot in solving the problem sooner.
And then we all jump out and yell "surprise! we got you this tiny ad!"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Exception: java.lang.ClassVersionError:
help !!
Web Service with build.xml
Transmogrify
Strange Problem in Running Jar!
More...