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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger


Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
hello everyone,

this is the only place i can get help !

Here are the details

I have an html page, then i get the parameters to the servlets.
Then i have a standalone class responsible for data base connection.

Here is the directory structure
c:\my projects\boaintegratedworkflow\src\com\system33\model\

The source code is :

package com.system33.model;
import java.sql.*;
public class MyOracleConnection {
public String result="uninitialized" ;
public Connection conn=null;
public Connection connectionDriver() {
try {
conn = DriverManager.getConnection("jdbc racle:thin:@localhost:1521:XE", "system","administrator");
} catch (Exception e) {
result="error in connection";
return conn;
public String fetchData() {
try {
Statement stmt = this.connectionDriver().createStatement();
String query="select * from boaiw";
ResultSet rs = stmt.executeQuery(query);
while( {
} catch (Exception e) {
//result="error in data return" ;
return result;
public static void main(String[] args) {
com.system33.model.MyOracleConnection obj=new com.system33.model.MyOracleConnection();

This is the servlet Code

c:\my projects\boaintegratedworkflow\src\com\system33\model\

package com.system33.web;
import com.system33.model.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class Submit extends HttpServlet {
public Connection conn;
public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,

ServletException {
PrintWriter out=response.getWriter();
out.println("Selection Advice<br>");
out.println("<br> Value of connection ");
com.system33.model.MyOracleConnection obj = new com.system33.model.MyOracleConnection();
out.println("<br> Data Fetched "+obj.fetchData());
out.println("<br> Data Fetched "+obj.connectionDriver());
out.println("<br> This is the new servlet<br>");


The class file lands in
c:\my projects\boaintegratedworkflow\classes\com\system33\model\MyOracleConnection.class
c:\my projects\boaintegratedworkflow\classes\com\system33\web\Submit.class

And this is not fetching the data, it throws an exception whic i am not able to see as its not being displayed on the page

Please Help me guys ! i need it
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please continue the conversationover here.
Hey! Wanna see my flashlight? It looks like this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic