• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

oracle connection

 
haritha hari
Greenhorn
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9295
10
Linux Mac OS X Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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().
 
haritha hari
Greenhorn
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not using code tags...
Thanq for your reply.....
 
haritha hari
Greenhorn
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What error are you getting?
 
haritha hari
Greenhorn
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not getting error..

And output is in correct....

 
jatan bhavsar
Ranch Hand
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you printing out the exception? If there were an error, that is where it would be reported.
 
haritha hari
Greenhorn
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting name and pwd fields using the code... from action class



 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The lines i wrote in action class

for name and pwd is as follows


 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's great. Now how do you create a string that contains those values?
 
haritha hari
Greenhorn
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry i didnt get u...?
 
Joe Ess
Bartender
Posts: 9295
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
Chrome Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having minimum knowledge on java

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



Ok

thanq....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic