Home Answers Viewqa JSP-Servlet Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..

 
 


sushma
Unable to connect servet, jsp to oracle 10g database.. Unable to retrieve data..
0 Answer(s)      a year and 3 months ago
Posted in : JSP-Servlet

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 Pages:
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.... If I use it also, unable to connect to backend oracle database. Let me...) { 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
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 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
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
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
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
jsp page connectivity with oracle - SQL
jsp page connectivity with oracle  I am unable to database connectivity jsp with oracle. Please send the code for solving problem. thanks ...: Class.forName("oracle.jdbc.driver.OracleDriver"); 3) Connect to database
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
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
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
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
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
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
storing date from html form to oracle 10g using servlet
this date month year from html form into oracle 10g database where i have...storing date from html form to oracle 10g using servlet  i have...","ors"); // code for inserting date into oracle 10g in the format of oracle
jsp-oracle validation - JDBC
jsp-oracle validation  Dear friends, my validation not takes place.... --------------------------------------- logoutaction.jsp --------------------------------------- oracle 10g.... Pl. as this code is very urgent and I tried a lot but unable to find out
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
Display Data from Database in JSP
Display Data from Database in JSP    This is detailed java program to connect java application with mysql database...;red"></b> <% out.println("Unable to connect to database
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...(request,response); } } .i am unable to redirect..here is the code..pls
Unable to understand Struts - Struts
Unable to understand Struts  I am studying in GNIIT from NIIT. Here... but in that application when I enter the details of book, data base becomes updated..."); BookService bs=new BookService("C:\\data\\"); String
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
Dropdown code to retrieve result from oracle database
Dropdown code to retrieve result from oracle database  Hi Friends, I... retrieve the result from Oracle database.We have procedures created already.Just... that will retrieve values from the database into dropdown. As the user choose any option
java and oracle - JSP-Servlet
to upload the resume of the employee and store it into database and retrieve the same... data types in oracle database. And I need to write the code in servlets and jsp
ORA-01019: unable to allocate memory in the user side
ORA-01019: unable to allocate memory in the user side  when i trying to oracle i got the following error.. ORA-01019: unable to allocate memory in the user side... How to resolve in oracle
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
Display Data from Database in JSP
, to show data from the database click on the link that calls another .jsp file named...;body> <h2>Data from the table 'stu_info' of database 'student'</h2... and password to connect to database. */ connection
How to get data from Oracle database using JSP
problem in jsp in the sense to get data from the database like oracle . I have... data from the database like oracle), I have created one jsp program like... the answer to retrieve data from the database by using servlet or jsp program
connect with Database - SQL
connect with Database  Hi, when ever i m trying to connect with 10g... problem with java 2 v1.4 with oracle 10g. But it worked well with the same code...(WrapperDataSource.java:94) plz give me solution for this..   make sure your oracle
How to Upload a file directly to Oracle database using JSP or Servlets?
How to Upload a file directly to Oracle database using JSP or Servlets?  Hi I want to upload a file(csv or excel) to Oracle 10g Database using JSP... FileItem file = (FileItem) items.get(2); // Connect to Oracle
oracle - JDBC
oracle  HI i am using ORACLE 10g. How to i find "TNSNAMES.ORA" file in my system after installation of ORACLE 10g succussfully. please send...)) (CONNECT_DATA= (SERVICE_NAME=service_name))) DESCRIPTION contains
error oracle database connection?
error oracle database connection?  hi now i am trying to connect oracle database and also insert my data into table, but it's not working.. I created one user registration form. when i give values in the form, i want stored data
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.
code save word file in 10g database - SQL
code save word file in 10g database  I am not having any idea to save the whole word document in Oracle 10g. Please help me.   Hi Friend... = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:3306:test","root", "root
i am getting the problem when i am downloading the pdf file from oracle 10g database - Struts
i am getting the problem when i am downloading the pdf file from oracle 10g... into datbase and download the pdf file from database. but when i created the pdf file from the struts application(itext.jar),it is uploading into database
Connect JSP with mysql
; This query creates database 'usermaster' in Mysql. Connect JSP...;Unable to connect to database."); } %> </font> </body>... with specified mysql database : Output of the program when unable to connect
retrieve data from mysql database
retrieve data from mysql database  hi am not familiar in php.....even... selected value on combobox which is to be retrieve the relevant data from mysql database using php.... below my code is that.. <html> <head>
Connect JSP with mysql
you how to connect to MySQL database from your JSP code. First, you need to create database and then write jsp code to connect jsp to database. 1. Create... database in my sql command prompt) 2. Connect JSP with mysql: 
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... to the database and retrieves the data from database. After getting the values from
connect netbeans with oracle
connect netbeans with oracle  how to connect netbeans with oracle.../jsf/visual-jsf.shtml Here you will find the steps to connect netbeans with mysql database. Thanks
Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list... from the dropdown, related data will get displayed on the textboxes. Here we have
retrieve data from database using jsf
retrieve data from database using jsf  Hello I want an example of source code to retrieve data from database i have a database (oracle) name as db1...),, name ,and city I want after enter value in textbox according idauthor i retrieve
how to load a table of data from oracle, to a jsp page using hashmap.
how to load a table of data from oracle, to a jsp page using hashmap.  I have a jsp page which ask for project ID,team name,member name according to this data i have to retrieve their details from the database(oracle). I have
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 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