Any One can help me..??OC4J in Oracle9iAS

I am running the servlet which is giving me the following exception.
"Error communicating with EJB-server: Database error: Io exception: The Network Adapter could not establish the connection; nested exception is: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection "
Thanks in advance.
The code is as follows:
// EmployeeServlet.java
package com.webstore;
import java.util.*;
import java.io.IOException;
import java.rmi.RemoteException;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.net.*;
public class DepartmentServlet extends HttpServlet
DepartmentHome home;
public void init() throws ServletException
try {
Context context = new InitialContext();          
//Object homeObject = context.lookup("java:comp/env/EmployeeBean");
Object homeObject = context.lookup("Department");
home =     (DepartmentHome) PortableRemoteObject.narrow(homeObject,
DepartmentHome.class);
} catch(NamingException e) {
throw new ServletException("Error looking up home", e);
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
response.setContentType("text/html");
ServletOutputStream out = response.getOutputStream();
try
Collection recs = home.findAll();
out.println("<html>");
out.println("\t<head><title>Department Bean</title></head>");
out.println("\t<body>");
out.println("\t\t<table border=\"2\">");
out.println("\t\t\t<tr><td>" + "<b>DptNo</b>"
+ "</td><td>" + "<b>DptName</b>"
+ "</td></tr>");
Iterator iterator = recs.iterator();
while(iterator.hasNext()) {
     Department rec =
     (Department) PortableRemoteObject.narrow(iterator.next(),
Department.class);
     out.println("\t\t\t<tr><td>" + rec.getDptno()
          + "</td><td>" + rec.getDptname()
          + "</td></tr>");
out.println("\t\t</table>");
out.println("\t</body>");
out.println("</html>");     
} catch(RemoteException e) {
out.println("Error communicating with EJB-server: " + e.getMessage());
} catch(FinderException e) {
out.println("Error finding records: " + e.getMessage());
} finally {
out.close();
Can anyone guide??

Hi,
I am getting output from database table all the entries in my browser, I am having a simple error..Number Format exception. Can anyone guide what's wrong with this jsp??
<%@ page import="com.webstore.*,java.io.*,java.net.*,java.util.*,javax.naming.*,javax.rmi.*" %>
<%
response.addHeader("Pragma", "no-cache");
response.addHeader("Cache-Control", "no-store");
PrintStream errorStream = System.err;
String error = null;
Exception exception = null;
DepartmentHome home = (DepartmentHome) session.getAttribute("DepartmentHome");
if (home == null) {
Context context = null;
try {
context = new InitialContext();
} catch (Exception e) {
exception = e;
error = "Caught \"" + exception.getClass().getName() + "\" while " +
"attempting to create the initial JNDI context.";
errorStream.println(error);
exception.printStackTrace(errorStream);
if (error == null) {
try {
Object boundObject = context.lookup("Department");
home = (DepartmentHome) PortableRemoteObject.narrow(boundObject,
DepartmentHome.class);
session.setAttribute("DepartmentHome", home);
} catch (Exception e) {
exception = e;
error = "Caught \"" + exception.getClass().getName() + "\" while " +
"attempting to lookup the Department bean at \"" + "\".";
errorStream.println(error);
exception.printStackTrace(errorStream);
Collection recs = null;
if (error == null) {
try {
recs = home.findAll();
} catch (Exception e) {
exception = e;
error = "Caught \"" + exception.getClass().getName() + "\" while " +
"attempting to find all DepartmentBean entries.";
errorStream.println(error);
exception.printStackTrace(errorStream);
String title;
if (error != null) {
title = "Error";
} else {
title = "Webstore | List of Departments";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE><%= title %></TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<H1><%= title %></H1>
<%
if (error != null) {
%>
<P><BLOCKQUOTE><%= error %></BLOCKQUOTE>
<%
if (exception != null) {
%>
<P><BLOCKQUOTE><CODE><%= exception %></CODE></BLOCKQUOTE>
<%
} /* if */
} else {
if (recs.size() == 0) {
%>
<P><BLOCKQUOTE>No entries found.</BLOCKQUOTE>
<%
} else {
%>
<P><TABLE border="1" width="100%">
<TR>
<TD><STRONG>DptNo </STRONG></TD>
<TD><STRONG>DptName </STRONG></TD>
<TD><STRONG>Actions</STRONG></TD>
</TR>
<%
Iterator iterator = recs.iterator();
while(iterator.hasNext()) {
Department rec = (Department) PortableRemoteObject.narrow(iterator.next(),Department.class);
long dptNo = rec.getDptno();
String dptName= rec.getDptname();
Hashtable cols = new Hashtable();
try
cols.put("DPTNO", Long.valueOf("dptNo"));
}catch(Exception nfe)
StringBuffer buf = new StringBuffer();
Enumeration params = cols.keys();
while (params.hasMoreElements()) {
String param = (String)params.nextElement();
String value = (String)cols.get(param);
System.out.println("Param"+param); //*******It is not displaying
System.out.println("Value"+value); //this & comes out of while loop
buf.append(URLEncoder.encode(param) +
"=" + URLEncoder.encode(value));
if (params.hasMoreElements())
buf.append("&");
String editURL = "dptedit.jsp?" + buf;
String deleteURL = "dptdelete.jsp?" + buf;
%>
<TR>
<TD><%= dptNo %></TD>
<TD><%= dptName %></TD>
<TD><a href="<%= editURL %>">Edit</a> <a href="<%= deleteURL %>">Delete</a></TD>
</TR>
<%
} /* for */
%>
</TABLE>
<%
} /* else */
} /* else */
%>
<P><TABLE border="1">
<TR><TD>Add entry</TD></TR>
</TABLE>
</BODY>
</HTML>
The Department Table is as follows.
SQL> desc department;
Name Null? Type
DPTNO NOT NULL NUMBER(10)
DPTNAME VARCHAR2(40)

Similar Messages

  • I bought a mini DVI to HDMI convertor and  a HDMI to VGA cable to connect my mac book pro to a tv but it doesn't work any one can help.\\\\\

    i bought a mini DVI to HDMI convertor and  a HDMI to VGA cable to connect my mac book pro to a tv but it doesn't work any one can help.

    I would suggest looking into a Thunderbolt to HDMI connector. In this case, you may be able to use the TV as an external monitor. For this option, please confirm through additional research. I have not tested it personally.
    You can also use an Apple TV, which connects with HDMI. In this case, you can use Airplay Mirroring. Not all Macs support Airplay Mirroring, so you need to check first. I have a Mid-2011 27" iMac, and it supports Airplay Mirroring. I don't use it often because my TV is in another room, but I just tried it and it worked. It had to change the screen resolution to work well, so I don't know if I would want to use it as my day to day monitor. http://support.apple.com/kb/ht5404

  • HT201263 I Have an iPhone 5 runnig ios 7.0.4. It wont start as the apple logo keeps on blinking when i connect to wall charger or itunes. I even tried to restore it but an error 21 is being displayed. Any one can help me in this situation

    I Have an iPhone 5 runnig ios 7.0.4. It wont start as the apple logo keeps on blinking when i connect to wall charger or itunes. I even tried to restore it but an error 21 is being displayed. Any one can help me in this situation

    Read http://support.apple.com/kb/ts3694#

  • Boot camp 5.0.1 aways crash when i try to create a partition for windows. My mac is new MBP retina.Any one can help me?

    boot camp 5.0.1 aways crash when i try to create a partition for windows. My mac is new MBP retina.Any one can help me?

    boot camp 5.0.1 aways crash when i try to create a partition for windows. My mac is new MBP retina.Any one can help me?

  • Hi, I need information about to change mi addrees and credit card from USA to Spain. Any ones  can help me?. Thank you

    Hi,
    I did my suscription two years ago living in Florida. Now I moved to Spain and I need to change my addreess and my credit card to continue with my Adobe Icloud suscription. Any one can help me? Thank you

    Some Change/Verify Account links https://forums.adobe.com/thread/1465499 that may help
    -Credit card https://helpx.adobe.com/x-productkb/policy-pricing/membership-subscription-troubleshooting -creative-cloud.html
    -http://helpx.adobe.com/x-productkb/policy-pricing/change-country-associated-with-adobe-id. html

  • Any one can help how to install sharepoin2013 in multi servers .any deployment guide please provide

    Any one can help how to install sharepoin2013 in multi servers .if you have any  guide please provide

    I am sharing few links which can be helpful for you to understand and install/configure multi server sharepoint environment.
    Install SharePoint 2013 across multiple servers for a three-tier farm
    Test Lab Guide: Configure SharePoint Server 2013 in a three-tier farm
    Install and Configure SharePoint farm (3 -tier)
    Office Web Apps 2013 multi servers (NLB) Installation and Deployment for SharePoint
    2013 step by step guide
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer.

  • Does any one can help me on Oracle cycles

    Hi Gurus,
    Does any one can help me getting documents of People to pay cycle or Recruit to retaire cycle Please.
    I am in need of them .
    Thanks in advance for your time and consideration.

    If you mean the Time Capsule's internal drive, click here and follow the instructions.
    If you mean an external drive used with Time Machine, install the MacDrive trial on the PC and then plug it in normally.
    (96092)

  • I m trying to import some picture from my iphoto library but element 12 don't show me the iphoto dialog box , as I can see on my classroom book and in many tutorial.any one can help please

    I m trying to import some picture from my iphoto library but element 12 don't show me the iphoto dialog box ,where i choose what i want to import,  as I can see on my classroom book and in many tutorial.any one can help please ? thanks

    I have the same problem... but the photo library is neither on my iPhone or my Computer!! Please help.. its taking too much space.

  • Ussd not Working on my iphone 5 Ios 7.0.3 i am form India , BSNL Carrier  Any one can Help me please . when i dail *123# then can't work its direct dailing.

    Ussd not Working on my iphone 5 Ios 7.0.3 i am form India , BSNL Carrier
    Any one can Help me please . when i dail *123# then can't work its direct dailing.

    Not ony for BSNL, Not working for all carriers in India right from 7.0 , 7.0.1, 7.0.2 and 7.0.3
    Apple needs to work it out in their  upcoming patch , All older versions of iphones from 4 and 4s works perfectly without any flaw  right from 7.0

  • How to delete a contact from wifi in mac pro, any one can help me

    how to delete a contact from wifi in mac pro, any one can help me

    Apple menu > System Preferences > Network > Airport > Advanced > Airport and then click on it and click the minus sign.
    You also can drag them in order of connection attempts.

  • Mc Book Air 13 won't start up. Any one can help? Please!

    Any one can help please,

    Thanks. Mc Book Air 13. Model A 1369/2011. Charger is connected. I plugged inn the charger and turned off the power button last night before I sleep. It's power on but couldn't log in/strait up. Showing only apple symbol. Thanks for your concerning.

  • Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please.

    Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please before I throw it through the window!

    Grum12 wrote:
    Hi I'm a total novice, as you will see. But Iam trying to use template of an employee schedule but when I try to add extra columns it does not add the preset formula with it, so it works out total hours and total pay?   If any one can help please before I throw it through the window!
    Hi Grum,
    If the formulas aren't filling to the new column, you must have changed something in the template since you first opened it. Numbers is rather fussy about filling row content in columns as they are added. Only rows with the same expression in every Body Column will fill when a column is added. Just as an experiment, start a new Employee Schedule document from the Template Chooser and then add a column by clicking the Add Column handle in the upper right corner of the table. If that works, as it should, then think about what might have changed in your working document to disconnect that feature. Maybe we can figure it out together.
    Jerry

  • I can't remember the answers of my security questions and i lost my safety email as well.and i try to call number of uae support its not correct so any one can help me

    I can't remember the answers of my security questions and i lost my safety email as well.and i try to call number of uae support its not correct so any one can help me

    If you do not have access to the rescue email or you do not receive the reset email then you will need to contact AppleCare for assistance:
    http://support.apple.com/kb/HT5699

  • HT5699 Hi there, I forget my security questions. and we dont have  in my country apple contact number . any one can helpe ?

    Hi there, I forget my security questions. and we dont have  in my country apple contact number . any one can helpe ?

    Click here and ask the iTunes Store staff for assistance.
    (103095)

  • Hi there, I forget my security questions. and we dont have  in my country apple contact number . any one can helpe ?

    Hi there, I forget my security questions. and we dont have  in my country apple contact number . any one can helpe ?

    Click here and ask the iTunes Store staff for assistance.
    (103095)

  • Can't show image in the center of the jscrollpane ,any one can help

    i write a program to show image in the jscrollpane
    i create a class called ImageLabel (it extends jlabel) then i use
    ImageLabel im=new ImageLabel(imageicon)
    jscrollpane.setViewportView(im);
    validate();
    repaint();
    but it show the image in the left and top corner of the jscrollpane ,not in the center of the jscrollpane
    then i change the ImageLabel to JLabel ,:
    JLabel im=new JLabel(imageicon);
    jscrollpane.setViewportView(im);
    validate();
    repaint();
    it shows the image in the center of the jscrollpane,
    but i want to use ImageLabel not jlabel
    whats the problem ,any one can help me ,thank you:)

    the ZoomLabel is the imagelabel ,and my complete code as follows:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    class ZoomLabel extends JLabel
        private ImageIcon icImage;   
        private int ph,pw,picW,picH;    
        ZoomLabel(ImageIcon ic)   
            super(ic, JLabel.CENTER); 
            icImage = ic;
            pw = picW = ic.getIconWidth(); 
            ph = picH = ic.getIconHeight();
           setSize(pw,ph);
           setPreferredSize(new Dimension(pw,ph));
           repaint();
          validate();
           public void zoom(float scale)    
               ph = Math.round(picH * scale);         
               pw = Math.round(picW * scale);          
               setPreferredSize(new Dimension(pw,ph)); 
               repaint();
             public void paint(Graphics g)     
                     update(g);     
                public synchronized void update(Graphics g)     
                {             g.drawImage(icImage.getImage(),0,0,pw,ph,this); 
      public class ImageShow extends JFrame
                  ImageShow()
                 ImageIcon ii=new ImageIcon("e:/download/pic/me1.JPG");
                   JScrollPane js=new JScrollPane();
                   zl=new ZoomLabel(ii);
                  js.setViewportView(zl);
                  getContentPane().add(js,"Center");
                     js.repaint();
                                  js.validate();
                  pack();
                  setVisible(true);     
             public  static void main(String[] args)
                   new ImageShow();
             ZoomLabel zl;
        }

Maybe you are looking for

  • Reg cleared items

    hi,           my doubt is that, for an acount if debit side is equal to credit side, can we clear this items at any time or there any conditions to clear account, i had raised this doubt because while i am creating a downpayment entry, in the end i f

  • Filtering out specific language in mapping

    Hi all, I have an interface IDoc -> PI -> Legacy file system (XML file). There is a string field in source and target messages of the mapping. This field may contain text in English or non-English language. Assume that combination of both will not oc

  • Get description of tables and columns

    Good afternoon. Is there any option in SAP B1 to get a description of table and column dynamically? That is, without the "Tools -> Queries -> Query Generator"? I am developing an add-on, which lists all the tables and columns of the sap, and I have t

  • Authorization error in BI 7.0

    We have upgraded recently security model from 3.5 to 7.0.After  upgrading the Profit center authorizations are working fine but the costcenter authorizations are not working .any help is really appreciated.iam getting the error mentioned below. we ar

  • BPEL forEach in JDeveloper?

    Using Jdeveloper 11.1.1.3.0 -- is there a way to use the BPEL 2.0 <forEach> element? The design palette in Jdev has <while> but no <forEach> or <repeatUntil>. Thanks.