• 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

oracle connection

 
Greenhorn
Posts: 29
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry for not using code tags...
Thanq for your reply.....
 
haritha hari
Greenhorn
Posts: 29
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What error are you getting?
 
haritha hari
Greenhorn
Posts: 29
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not getting error..

And output is in correct....

 
Ranch Hand
Posts: 300
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am getting name and pwd fields using the code... from action class



 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The lines i wrote in action class

for name and pwd is as follows


 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's great. Now how do you create a string that contains those values?
 
haritha hari
Greenhorn
Posts: 29
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry i didnt get u...?
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic