hi guys here...igot a minor problem and im sure you guys will easily figure it out..coz im new to programming... currently i just wan a simple form that can store datas into an oracle database called toad.i hav simply 2 pages, one is appsform.jsp and the other is appsdata.jsp
but i cant seem to put those values into the toad table in the database..can u guys help me figure out wads wrong?
Print ur querytext before calling executeQuery(). Just see whether the insert string formed is correct or not. Also add a line e.printStackTrace() in ur exception block. Hope u will get a solution after this.
It'll be easier to figure out the error if you specify what problem you are facing.. Coding seems to be all rite..
Joined: Jul 30, 2004
thx guys..atul i will try use ur method ltr..thx a lot.. the problem im facing rite now is that...when i enter values in the form and click submit, it can process to the page called success.jsp but when i look at the toad database, the table is empty...
Joined: Dec 17, 2002
This is just a wild guess. Hope this solves ur problem.
w.r.t to ur code if there is a exception it would include fail.jsp content into ur current jsp page. But just after the exception block u have given response.sendRedirect(). So even if there is a exception the code would redirect it to success.jsp. Try placing response.sendRedirect() in the try block.
Hope this works.
Joined: Jul 30, 2004
thx guys sorry, sorry for late reply..i've been tired trying all the solutions but to no avail...is toad oracle database doesnt evolve in a full blown jdbc components like one guy says or isit tt my codes aint right?
Did u try placing response.sendRedirect()in the try block. Or did u write a println statement in the exception block. There is problem in the code. Please do try this.U cant just blindly say the codes not working, u have to try all posssible combination.
What you need to do is try to narrow down where the problem may be. Put some 'System.out.print' statements to see whether the correct parameters are being passed, whether any exceptions are being thrown etc.
Put an exception.printStackTrace(System.out) in your catch block, so you know what exceptions if any are being thrown. If everything else is ok, and only the database is not being updated, you could be getting a SQLException