This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am new to the JDBC forum, but I did post a JDBC question in the Java Beginner forum. I am still stuck so thought I would try this one out. Any ideas??
If this post is a little messed up, look at the post labeled Class.forName error in the beginner thread. I just copied and pasted from there. I realized that I should have probably posted to this one first, and couldn't just 'move' the post.
Thanks everyone! Amy
OK, I tried using java.lang.forName(...) and it worked. So thanks! I also tried the Class.class.forName() and there it was! All ready to work. Man oh man...
Now, I have one more issue and then I will stop bugging everyone for a bit; I promise. I am trying to connect to a db and insert records into it. The insert works, but I also get an exception, saying that "No ResultSet was produced SQL State: null". I have my code in try / catch blocks so it catches the errors. It inserts the record fine, but still gives me the error BEFORE it reports the insert. So, I commented out the code to write the record to the database and I get strange results: every field comes up as null in the console (there are only 6 fields right now). Here is my code:
Amy, You need to call executeUpdate() rather than executeQuery() on insert, delete or update statements.
For the future, you can edit your post by clicking the icon that looks like a pencil and paper. It's the third icon from the left near the top of your post.
In this case, it was fine to post a new thread as it was a different question based on the same code. (Class.forName vs resultsets.) If you accidently post in the wrong forum, you can ask a forum bartender or any sheriff to move your thread to the correct forum for you. This will also preserve any discussion on the topic. [ April 09, 2005: Message edited by: Jeanne Boyarsky ]