File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes oracle connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "oracle connection" Watch "oracle connection" New topic
Author

oracle connection

haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

My Action class code is :




And databse connection code is :

Is there Any wrong in code for oracle dabtabse connection using struts...

Thanq

Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

Welcome to the JavaRanch.
I added code tags to your post. Code tags make your code easier to read so please use them in the future.
As for your code, never ever Ever EVER do this:



If something were wrong with your code, you would never know. At a bare minimum, invoke e.printStackTrace().


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

Sorry for not using code tags...
Thanq for your reply.....
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29



In above code oracle database takes name and pwd as column vallues

but i want to insert values in that name and pwd


For this problem what should i do..?

please tell me...

Thanq
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

What error are you getting?
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

I am not getting error..

And output is in correct....

jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Haritha,

How will you get the name and pwd filed ?? you need to pass name pwd value from somewhere.

Regards
Jatan
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

Are you printing out the exception? If there were an error, that is where it would be reported.
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

Yes i am printing the statement in catch block.

It does not show any error..

The Output where i am getting wrong is


After this line execution the row will be inserted in reg.

The row that was inserted is incorrect.

Insted of inserting values in name and pwd in reg table.

It takes name and pwd it self as row values..

This is the problem
please tell me the solution..
please

Thanq
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

I am getting name and pwd fields using the code... from action class



Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

haritha hari wrote:

Insted of inserting values in name and pwd in reg table.

It takes name and pwd it self as row values..


That's exactly what you are telling it to do. How would you create a string that contains the values of name and pwd?
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

The lines i wrote in action class

for name and pwd is as follows


Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

That's great. Now how do you create a string that contains those values?
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

Sorry i didnt get u...?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

Perhaps you should spend some time reading the Java Tutorial. You are going to find it very difficult to use Struts unless you know the basics of how to use Java.
haritha hari
Greenhorn

Joined: Nov 14, 2012
Posts: 29

I am having minimum knowledge on java

Mean while the problem is solved and the action code is as follows...



Ok

thanq....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: oracle connection