Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..

Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..

I have a class file AbstractDataAccessObject with the below code.

package com.dts.core.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

import com.dts.core.util.LoggerManager;

public class AbstractDataAccessObject
{
    public Connection mCon;
    private static Properties mProps;

    /**
     * @return the props
     */
    public Properties getProperties()
    {
        return mProps;
    }

    /**
     * @param props
     *            application properties object
     */
    public void setProperties(Properties aProps)
    {
        mProps = aProps;
    }

    public Connection getConnection()
    {
        try
        {
            Properties aProps = getProperties();
            System.out.println(aProps.getProperty("driver"));
            Class.forName(aProps.getProperty("driver"));
            mCon = DriverManager.getConnection(aProps.getProperty("url"), aProps.getProperty("duser"), aProps.getProperty("dpass"));
            System.out.println(mCon);
        }
        catch (ClassNotFoundException cnfe)
        {
            LoggerManager.writeLogWarning(cnfe);
        }
        catch (SQLException se)
        {
            LoggerManager.writeLogWarning(se);
        }
        return mCon;
    }

/*  public Connection getConnection(String cp)
    {
        try
        {
            Properties aProps = getProperties();
            Class.forName( aProps.getProperty("driver") );

            String JNDI = aProps.getProperty("JNDI_NAME");

            try
            {
                InitialContext ictx = new InitialContext();
                DataSource ds = (DataSource) ictx.lookup(JNDI);
                mCon = ds.getConnection();
            }
            catch (NamingException ne)
            {
                LoggerManager.writeLogWarning(ne);
            }
        }
        catch (ClassNotFoundException cnfe)
        {
            LoggerManager.writeLogWarning(cnfe);
        }
        catch (SQLException se)
        {
            LoggerManager.writeLogWarning(se);
        }
        return mCon;
    }*/

    public int getSequenceID(String tableName, String pkid)
    {
        int id = 0;
        try
        {
            mCon = getConnection();
            Statement st = mCon.createStatement();
            ResultSet rs = st.executeQuery("select max("+pkid+") from "+tableName); 
            if(rs.next())
                id=rs.getInt(1);
            id++;
        }
        catch(SQLException se)
        {
            LoggerManager.writeLogWarning(se);
        }
        catch(Exception e)
        {
            LoggerManager.writeLogWarning(e);
        }
        finally
        {
            try
            {
                mCon.close();
            }
            catch(SQLException se)
            {
                LoggerManager.writeLogWarning(se);  
            }
            catch(Exception e)
            {
                LoggerManager.writeLogWarning(e);
            }
        }
        return id;
    }
}

The data for the connection to the database is specified in the Web-inf >> config >>system.properties.

The code is as follows

# Sample ResourceBundle properties file

JNDI_NAME=java:com/env/Oracle/jndi
db.login=   
db.password= 
driver=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@192.168.100.20:1521:server
duser=ware
dpass=ware
logfile=E:/log/warehouse_log.txt
dbname=oracle

Let me know what is the duser and dpass.. ? I have created a new user from oracle sql*plus as rajalakshmi and password by granting privilege from scott and tiger. should I use the duser and dpass as rajalakshmi and password for duser and dpass.. or scott and tiger.

But nothing of the duser and dpass works.

If I use it also, unable to connect to backend oracle database.

Let me know what is db.username and db.password? should I leave it blank ?

View Answers









Related Tutorials/Questions & Answers:
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data... it also, unable to connect to backend oracle database. (adsbygoogle...) { LoggerManager.writeLogWarning(e); } } return id; } } The data
java script unable to connect to oracle database and insert data
java script unable to connect to oracle database and insert data  ... is to insert data from jsp to oracle database 8, so i create a table in oracle... jsp coding in rose india for sql and i changed the drivers for oracle.. when i try
Advertisements
unable to connect database in java
unable to connect database in java  Hello Everyone! i was trying to connect database with my application by using java but i am unable to connect... Driver Manager] Data source name not fou nd and no default driver specified
unable to connect database in java
unable to connect database in java  Hello Everyone! i was trying to connect database with my application by using java but i am unable to connect...: [Microsoft][ODBC Driver Manager] Data source name not fou nd and no default driver
unable to connect to server - JSP-Servlet
unable to connect to server  thank you for the program code for inserting and reteriving the image but i am unable to deploy these two programs..., create a web application folder inside the webapps folder and put the jsp file
unable to insert data into database
unable to insert data into database    hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to insert data into database
unable to insert data into database    hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to insert data into database
unable to insert data into database    hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to insert data into database
unable to insert data into database    hello.i have a problem in inserting data into database.i have used two prepared statement.one for retrieving the eid based on ename and the other is inserting data into database based
unable to get datas from oracle database
unable to get datas from oracle database  Dear Sir, I am again struck in my project.. i want to display data from oracle database but i get... org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 9 in the jsp
android connection to database oracle 10g
android connection to database oracle 10g  Hello, How i can connect my android application to my oracle 10g database
unable to display table data on JSP page that is coming from mysql and servlet.
unable to display table data on JSP page that is coming from mysql and servlet.  I am unable to show table data on JSP page using servlet and mysql. only two rows data i showing but in my database I have five fields
unable to display table data on JSP page that is coming from mysql and servlet.
unable to display table data on JSP page that is coming from mysql and servlet.  I am unable to show table data on JSP page using servlet and mysql. only two rows data i showing but in my database I have five fields
unable to display table data on JSP page that is coming from mysql and servlet.
unable to display table data on JSP page that is coming from mysql and servlet.  I am unable to show table data on JSP page using servlet and mysql. only two rows data i showing but in my database I have five fields
Unable to store the image into database
Unable to store the image into database  Hello, I have created below... button. The problem is coming due to JSP page is not able to find complete path of image. I have debug the JSP program and found that HTML form pass only image
Unable to execute JSP page
Unable to execute JSP page  I have written one jsp file. It contains html tags and jsp directives. I have saved the file with the extension .jsp. The tomcat server is already running onto my machine. I have saved the jsp file
how to retrieve data from database
how to retrieve data from database  unable to retrieve data from database using mySQL by using jsp sessions and beans for editing
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp
data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp   data (image ,audio) inserting to data base (oracle 10g) and retriving the same data from jsp with script of data base plz help me
error in uploading image from jsp to oracle 10g database
error in uploading image from jsp to oracle 10g database  ... try to insert into the image into the database i got the above error please advice how to get rid of error   JSP upload image in Mysql database
Insert or retrieve image into oracle 10g by using java
Insert or retrieve image into oracle 10g by using java   How can i insert or retrieve image into oracle10g using java plz i need it urgently,need guidance to do this plz
Retrieve database from the table dynamically in jsp from oracle using servlet
Retrieve database from the table dynamically in jsp from oracle using servlet  Sir, I have created a table in oracle using eclipse, and added few... using java servlet from the database in the jsp page
Unable to compile class for JSP - WebSevices
Unable to compile class for JSP  org.apache.jasper.JasperException: Unable to compile class for JSP When I am trying to access a java file kept under src folder under a package from a jsp page placed under web directory, I am
Unable to upload a file to mysql database using struts1
Unable to upload a file to mysql database using struts1  Hi, Below are my classes 1.upload.jsp <%@ taglib uri="/tags/struts-html" prefix="html...="multipart/form-data"> Select a File :<html:file property="file"/> <
Unable to run the jsp page - JSP-Servlet
Unable to run the jsp page  Expert:Naga Hi, I need solution this program. In cart.jsp I printed the total amount of the products then the next... details should be stored in ?orders? table in the ?shopping ? data base
Unable to call .jrxml file from jsp
Unable to call .jrxml file from jsp  Hi, I am doing web application in jsp. To create report I have used ireport and interated with neatbeans using... then it unable to access it.Error also not showing. I will show my code and its output
unable to compile class file - JSP-Servlet
unable to compile class file  I wrote database connection in jsp file.... In database i have a employeeid field. How can i display all employee id...("/jsp/Combobox.jsp"); dispatcher.forward(request, response
Struts2...problem in JSP..unable to get the values for menuTitle!!!
Struts2...problem in JSP..unable to get the values for menuTitle!!!  **Hello everyone... i'm trying to make a dynamic menu from database in struts2... Jsp is displaying the menuId from database but not the menuTitle...where as its
jsp with excel sheet data uploading into database
jsp with excel sheet data uploading into database  how to upload data in excel sheet with jsp into oracle 10g database
connect to the database from JSP
connect to the database from JSP  How do you connect to the database from JSP?   A Connection to a database can be established from a jsp page by writing the code to establish a connection using a jsp scriptlets
How to get data from Oracle database using JSP
How to get data from Oracle database using JSP  hello i have a simple problem in jsp in the sense to get data from the database like oracle . I have... the database like oracle), I have created one jsp program like this *<@ page
Unable to get data from class - Development process
Unable to get data from class  I get this code from the internet which read from comm port of the computer & modify is as below:- package COM; /** * * @author kwngeaw */ import javax.comm.*; import java.io.
retrieve related data from database using jsp and mysql
retrieve related data from database using jsp and mysql  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list. if we change a value in a dropdown its related value must
Unable to run jsp files on internet explorer - JSP-Servlet
Unable to run jsp files on internet explorer  Hi, I am Akhilesh Shrivastav. I am new to jsp and a new member of this site. My problem is i wrote a small jsp program stored in the Web-Apps folder of Apache Tomcat. But i
how to read data from excel file through browse and insert into oracle database using jsp or oracle???
how to read data from excel file through browse and insert into oracle database using jsp or oracle???  sir.. i have number of excel sheets which... be inserted into oracle database.. please help me sir...   hi friend
Dropdown code to retrieve result from oracle database
Dropdown code to retrieve result from oracle database  Hi Friends, I... contains dropdowns in frontend(Javascript or JSP).If i choose an option,it should retrieve the result from Oracle database.We have procedures created already.Just
Unable to bind to a hashmap from jsp using spring tags - Spring
Unable to bind to a hashmap from jsp using spring tags  Hi, I am unable to bind a hashmap from my jsp page. Here is what i want to do: I have an arraylist in a jsp page. As i loop through the array list, for each element i
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to retrieve data from database ?????/
how to retrieve data from database ?????/  how to retrieve data from database
how to generate reports from oracle database using jsp and ajax code
sales report data from oracle database to jsp page please any one know how to do...how to generate reports from oracle database using jsp and ajax code  ... member Java programmer unable to do this task..so its burden on me to finish
How to connect to the database to my application if my database is made up in oracle
How to connect to the database to my application if my database is made up in oracle   How to connect to the database to my application if my database is made up in oracle
Calling Servlet to build a List of data from database and show this on the JSP page in table
Calling Servlet to build a List of data from database and show this on the JSP... to retrieve all the data from database and then add the data into list. The list... the connection to the database and retrieves the data from database. After getting
unable to retrive the data from mysql using servlet using jdbc driver
unable to retrive the data from mysql using servlet using jdbc driver ... to the database"); stmt = con.createStatement(); rs...,response); } } .i am unable to redirect..here is the code..pls help me THANK
java servet +jsp+mysqldatabase
java servet +jsp+mysqldatabase  I created three servlets(based on title, bookname, author) and one jsp page. in jsp page i put one dropdown list box(that is title, author, bookname) and created mysql database column values
unable to execute the examples
unable to execute the examples  unable to execute the examples given for struts,ejb,or spring tutorials.Please help I am a beginner
Unable to Create DSN for
Unable to Create DSN for   I have installed Oracle 11g R2 and JDK7... Driver. I'm unable to crate DNS for "Microsoft ODBC for Oracle", It gives eror message (like Oracle client and networking components were not found. etc). What
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  //this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user
unable to validate username and password from ms acess database
unable to validate username and password from ms acess database  this code is not working! please help me to find error. thanks. <%@ page import="java.sql.*" %> <% Connection con=null; String user

Ads