• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

database connectivity

 
dipayan chatterjee
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

what is the procedure of connecting a struts application to a database . i want to connect a simple user registration application to my oracle 10g what are the steps to be followed to establish the connection
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are an endless number of ways of using databases.

If you're using a modern version of Struts (1.3, 2+) there's no Struts-specific ways. S1.2 continued to support a deprecated technique from S1.1, but it's not recommended.
 
dipayan chatterjee
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using struts 1.2 in that case how can i acheive database connectivity
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said, this isn't really a Struts question--you can use plain JDBC, Hibernate, iBatis, and so on, or use any of those with Spring.
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What David was trying to tell you is found here and If you are using Tomcat as a server, then you might be interested in this one.
 
dipayan chatterjee
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the help

i tried out connection my application to my oracle database but i am getting the following error
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

the line that is creating the problem i feel is
Class.forName("oracle.jdbc.OracleDriver");
Connection con=DriverManager.getConnection("jdbcracle:thin:@acer:1521:xe","system","sys");

what do you think went wrong

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that the oracle.jdbc.OracleDriver class could not be found.

This is not, however, a Struts issue--there's a JDBC forum.
 
Sagar Rohankar
Ranch Hand
Posts: 2906
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dipayan chatterjee wrote:
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver




Oracle driver JAR file needs to be in CLASSPATH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic