Class Help Please~~~

How can i access/use the other class's method's variable?
For example: There are 2 class, Trans and Rece
In class Rece, there is a method called initialize, in this method I have defined one identifier called ds;
public void initialize(){
DataSource ds = stream.getDataSource();
How can i use this ds in the other class: Trans?
Regards
Alpha

There are a couple of ways. The most basic way (not the best, but the easiest) is...
1. Put the datasource outside of the initialize so others can see it
public class Rece
  public DataSource ds;
  public void initialize()
   ds = stream.getDataSource();
}2. Now make a reference to it in the other class.
public class Trans
  public DataSource localDs;
  public void initialize()
    Rece r = new Rece();
    localDs = r.ds; // now localDs is a copy of the datastream from Rece
}

Similar Messages

  • WaterGlass class help please

    * WaterGlass.java
    * Created: Thu Nov 4 11:01:29 2004
    * @author Pyscho
    * @version 1.0
    public class WaterGlass {
    //FIeld/Attribute declarations
    private int amount;
    private int height;
    private int holelevel;
    private int width;
    private String state;
    private String indstate;
    private String dsline;
    public int starsonlevel;
    public WaterGlass() {
    } // WaterGlass constructor
    //constructor declarations
    public WaterGlass(int h, int w, int a, int hl) {
    //method declarations
    public String dotStartLine(int stars) {
    return dsline;
    public int flow() {
    return 1;
    public int getAmount() {
    return amount;
    public int getHeight() {
    return height;
    public int getHoleLevel() {
    return holelevel;
    public int getWidth() {
    return width;
    public void incAmount(int a) {
    amount++;
    public void setAmount(int w) {
    public void setHoleLevel(int hl) {
    holelevel =hl;
    public int starsOnLevel(int l) {
    return starsonlevel;
    public String toString() {
    return state;
    public String toString(int indent) {
    return indstate;
    } // WaterGlass
    * WaterTest.java
    * Created: Mon Jul 26 11:35:53 2004
    * @author Steve
    * @version 1.0
    public class WaterTest{
    public WaterTest (){
    public static void main(String[] args){
    WaterGlass w1 = new WaterGlass();
    WaterGlass w2 = new WaterGlass(7,7,40,3);
    w1.setAmount(15);
    w1.setHoleLevel(3);
    for (int i=0; i<18;i++) {
    w2.incAmount(w1.flow());
    w2.flow();
    System.out.println(w1.toString(0));
    System.out.println(w2.toString(6));
    System.out.println("\n\n\n");
    } // WaterTest
    I'm trying to get WaterTest.java to run off WaterClass.java, when i run it, it's not displaying the waterglasses, it just says null. Anyone have any suggesstions?

    thanks for your help mate, but im still a bit confused as to what to return in that method. this is from the documentation from the WaterGlass class..
    toString
    public String toString(int indent)
    Return a string representing the current, stable state of the glass. The whole glass is indented by a given number of spaces.
    Parameters:
    indent - the amount indentation
    Returns:
    a string representing the glass
    Can someone please give me suggesstions on what goes in the body of the method?

  • Calling arraylist from another class - help please!!

    Hey, I need some help calling my arraylist from my GUI class, as the arraylist is in the 'AlbumList' class and not in the 'GUI' class i get the error 'cannot find symbol', which is pretty obvious but i cannot figure how to get around this problem. help would be greatly appreciated.
    i have written ***PROBLEM*** next to the bad line of code!
    Thanks!!
    public class Album
        String artist;
        String title;
        String genre;
        public Album(String a, String t, String g)
            artist = a;
         title = t;
            genre = g;
         public String getArtist()
            return artist;
        public String getTitle()
            return title;
         public String getGenre()
            return genre;
    public class AlbumList
        public ArrayList <Album> theAlbums;
        int pointer = -1;
        public AlbumList()
            theAlbums = new ArrayList <Album>();
        public void addAlbum(Album newAlbum)
         theAlbums.add(newAlbum);
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class GUI extends JFrame
        public int max = 5;
        public int numAlbums = 4;
        public int pointer = -1;
        public GUI ()
            super("Recording System");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel main = new JPanel();
            JPanel panel1 = new JPanel();
            panel1.setLayout(new GridLayout(3,2,0,0));
            JPanel panel2 = new JPanel();
            panel2.setLayout(new GridLayout(1,2,20,0));
            final JLabel artistLBL = new JLabel("Artist: ");
            final JLabel titleLBL = new JLabel("Title: ");
            final JLabel genreLBL = new JLabel("Genre: ");
            final JTextField artistFLD = new JTextField(20);
            final JTextField titleFLD = new JTextField(20);
            final JTextField genreFLD = new JTextField(20);
            final JButton nextBTN = new JButton("Next");
            nextBTN.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    pointer++;
                    artistFLD.setText(theAlbums.get(pointer).getArtist());       ***PROBLEM***
                    titleFLD.setText("NEXT");
                    genreFLD.setText("NEXT");
            final JButton prevBTN = new JButton("Prev");
            prevBTN.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    pointer--;
                    artistFLD.setText("PREVIOUS");
                    titleFLD.setText("PREVIOUS");
                    genreFLD.setText("PREVIOUS");
         panel1.add(artistLBL);
            panel1.add(artistFLD);
            panel1.add(titleLBL);
            panel1.add(titleFLD);
            panel1.add(genreLBL);
            panel1.add(genreFLD);
            panel2.add(prevBTN);
            panel2.add(nextBTN);
            main.add(panel1);
            main.add(panel2);
            setVisible(true);
            this.getContentPane().add(main);
            setSize(500, 500);
    -----------------------------------------------------------------------Thanks!!
    Edited by: phreeck on Nov 3, 2007 8:55 PM

    thanks, it dosnt give me a complication error but when i press the button it says out of bounds error, and i think my arraylist may be empty possibly even though i put this data in.. this is my test file which runs it all.
    any ideas? thanks!!
    public class Test
        public static void main(String []args)
            AlbumList a = new AlbumList();
            String aArtist = "IronMaiden";
            String aTitle = "7thSon";
            String aGenre = "HeavyMetal";
            Album newA = new Album(aArtist, aTitle, aGenre);
            a.addAlbum(newA);
            aArtist = "LambOfGod";
            aTitle = "Sacrament";
            aGenre = "Metal";
            Album newB = new Album(aArtist, aTitle, aGenre);
            a.addAlbum(newB);
            aArtist = "JohnMayer";
            aTitle = "Continuum";
            aGenre = "Guitar";
            Album newC = new Album(aArtist, aTitle, aGenre);
            a.addAlbum(newC);
            aArtist = "StillRemains";
            aTitle = "TheSerpent";
            aGenre = "Metal";
            Album newD = new Album(aArtist, aTitle, aGenre);
            a.addAlbum(newD);
         GUI tester = new GUI();
    }

  • Can't find textbox class - help please!

    I'm posting this again, in the hope that more people might help. I already know that the error means that the compiler can't find the class Textbox. I need to know why, because I've copied the relevant parts of the code from another app that builds fine. So why won't this build?
    I'm trying to write and build my first J2ME app. My code starts:
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import java.lang.Math;
    public class TestMIDlet
    extends MIDlet
    implements CommandListener
    private Textbox tbMain;
    public void startApp()
    The build fails with numerous errors of which the first is:
    C:\WTK22\apps\TestMIDlet\src\TestMIDlet.java:9: cannot find symbol
    symbol : class Textbox
    location: class TestMIDlet
    private Textbox tbMain;
    with the caret under the 'T' of Textbox
    I don't understand what's wrong with this, as it's in many of the sample apps I've looked at.
    Thanks
    Ed

    Thanks very much!
    I've lost count of the times I've been caught by that case-sensitivity thing in Javascript. I thought it was just the first letter that had to be capitalised. Progress at last!

  • Two class help please

    alright, the main purpose is to compute how much it will cost if u enter a weight of the bag and the units....i have the math there, but i cant figure out what im doing wrong....any ideas, something isnt right i can see it,
    import java.text.DecimalFormat;
    import java.util.Scanner;
    import javax.swing.*;
    public class Coffee {
         public static void main(String[] args) {
              CoffeeBag checker = new CoffeeBag();
              int weight, numUnits;
              String numUnits1 = JOptionPane.showInputDialog(null, "Enter the number of bags: ");
              String weight1 = JOptionPane.showInputDialog(null, "Enter weight of the units in pounds: ");
              weight = Integer.parseInt(weight1);//string to int//
              numUnits = Integer.parseInt(numUnits1);
              checker.setNumberOfUnits(numUnits);
              checker.setUnitWeight(weight);
              DecimalFormat df = new DecimalFormat("0.00");
              Scanner scanner;
              scanner = new Scanner(System.in);
              System.out.println("Number of bags sold: " + numUnits);
              System.out.println("Weight per bag: " + weight);
              System.out.println("Price per pound: $5.99");
              System.out.println("Sales tax: 7.25%");
              System.out.println();
              System.out.println("Total Price: $" + df.format((float)checker.getTotalPrice()));
    class CoffeeBag {
    private final static double PRICE_PER_LB = 5.99;
    private final static double SALES_TAX = 0.0725;
    private int unitWeight, numberOfUnits;
    double totalPrice=0;
    double subtotal=0;
    double salesTax;
    double pricePerPound;
    //contructors//
    public CoffeeBag( int weight, int numUnits ) {
    String getWeight;
    String getNumUnits;
    public CoffeeBag() {
    int weight; int numUnits;
    //methods//
    public void setUnitWeight( int weight ) {
    unitWeight=weight ;
    public void setNumberOfUnits( int units ) {
    numberOfUnits=units;
    public int getUnitWeight() {
    return unitWeight;
    public int getNumberOfUnits() {
    return numberOfUnits;
    public double getPricePerPound() {
    return pricePerPound;
    public double getSalesTax() {
    return salesTax;
    public double getSubtotal() {
    return subtotal;
    public double getTotalPrice() {
    return totalPrice;
    }

    1) You have to tell us exactly what the problem is. People aren't going to guess, or compile and/or run your code to find out.
    2) When you post code, please use [code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.

  • Question about inner class - help please

    hi all
    i have a question about the inner class. i need to create some kind of object inside a process class. the reason for the creation of object is because i need to get some values from database and store them in an array:
    name, value, indexNum, flag
    i need to create an array of objects to hold those values and do some process in the process class. the object is only for the process class that contains it. i am not really certain how to create this inner class. i tried it with the following:
    public class process{
    class MyObject{}
    List l = new ArrayList();
    l.add(new MyObject(....));
    or should i create the object as static? what is the benifit of creating this way or static way? thanks for you help.

    for this case, i do need to create a new instance of
    this MyObject each time the process is running with a
    new message - xml. but i will be dealing with the case
    where i will need a static object to hold some
    property values for all the instances. so i suppose i
    will be using static inner class for that case.The two situations are not the same. You know the difference between instance variables and static variables, of course (although you make the usual sloppy error and call them static objects). But the meaning of "static" in the definition of an inner class is this: if you don't declare an inner class static, then an instance of that inner class must belong to an instance of its containing class. If you do declare the inner class static, then an instance of the inner class can exist on its own without any corresponding instance of the containing class. Obviously this has nothing to do with the meaning of "static" with respect to variables.

  • Help with loading dynamic classes ..need help please

    i'm trying to design a program where by i can load dynamic classes
    the problem i'm getting is that only one class is loading.
    classes are loaded by their names,and index numbers of public methods from a linklist
    .When the program runs only the first class is ever loaded and only the methods of that class ..
    help please
    //class loader
    import java.lang.reflect.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    public class Test2 extends Thread
         public Class c;
         public Class Ray;
         public Class[] x;
         public static Object object = null;
         public Method[] theMethods;
         public static Method[] method,usemethod;
         public int methodcount;
         public static int MethodCt;     
         public static JList list;
    public Method[] startClass(String SetMethodName)
         try
              c = Class.forName(SetMethodName);
              object = c.newInstance();
              theMethods = c.getDeclaredMethods();
              // number of methods
              //methodcount = theMethods.length;
         catch (Exception e)
              e.printStackTrace();
    // return the array then invoke the particular method later
    return theMethods ;
    public void RunMethod(Method[] SomeMethod, int methodcount)
         try
              SomeMethod[methodcount].invoke( object,null );
         catch (Exception e)
              e.printStackTrace();
    // end class loader
    //main calling program
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing .*;
    import java.lang.reflect.*;
    public class JFMenu extends JFrame
         public static JMenu pluginMenu;
         public static JMenuBar bar;
         public static final Test2 w = new Test2();
    public static Method[] setmethod;
    private static ClassLinkList startRef = null;
    private static ClassLinkList linkRef3 = null;
    private static ClassLinkList startRef2 = null;
    private String ClassName,ShortCut;
    private int MethodNumber;
    private JMenuItem PluginItem;
         JFMenu()
              super (" JFluro ");     
              JMenu fileMenu = new JMenu("File");
              fileMenu.setMnemonic('F');
              JMenuItem exitItem = new JMenuItem("Exit");
              exitItem.setMnemonic('X');
              fileMenu.add(exitItem);
              exitItem.addActionListener
                   new ActionListener()
                        public void actionPerformed(ActionEvent event )
                             System.exit(0);
              JMenu pluginMenu = new JMenu("Plugins");
              pluginMenu.setMnemonic('P');
              startRef = new ClassLinkList ("Hello","Hello ",2,1926,"Painter");
              addToList("Foo","Foo ",0,1930,"Author");
              while (startRef.linkRef5 != null)
                   //pluginMenu.addSeparator();
                   ClassName = startRef.linkRef5.className;
                   ShortCut = startRef.linkRef5.shortcutName;
    MethodNumber = startRef.linkRef5.methodNumber;
    AddMenuItem(pluginMenu,ShortCut,ClassName,MethodNumber);
                   startRef.linkRef5 = startRef.linkRef5.next;
              // create menu bar and add JFMenu window to it
              JMenuBar bar = new JMenuBar();
              setJMenuBar(bar);
              bar.add(fileMenu);
              bar.add(pluginMenu);
              //attributes for JFMenu frame
              setSize(500,200);
              setVisible(true);
         }// end JFMenu constructor
         public void AddMenuItem(JMenu MainMenu, String shortcut,String className, final int methodCount )
              if (MainMenu==null)
                   return;
              //JMenuItem item;
              JMenuItem item = new JMenuItem(shortcut);
              MainMenu.add(item);
              setmethod = w.startClass(className);
              item.addActionListener
                   new ActionListener()
                        public void actionPerformed(ActionEvent event )
                             w.RunMethod(setmethod,methodCount);
              //item.addActionListener(ij);
         public JMenuItem AddMenuItem2(JMenu MainMenu, String shortcut)
              //if (MainMenu==null)
              //     return Main;
              //JMenuItem item;
              JMenuItem item = new JMenuItem(shortcut);
              MainMenu.add(item);
              //setmethod = w.startClass(className);
              //item.addActionListener(this);
                   new ActionListener()
                        public void actionPerformed(ActionEvent event )
                             w.RunMethod(setmethod,methodCount);
              //item.addActionListener(ij);
         return item;
         public void ReloadMenu(JMenuBar Bar, JMenu PluginMenu)
              if (Bar==null)
                   return;
              //     setJMenuBar(Bar);
              Bar.add(PluginMenu);
              //item.addActionListener(ij);
    public static void main (String args[])
              JFMenu menapp = new JFMenu();
    public static void addToList(String clname, String shcutname, int metnumber, int year2,
                                  String description) {
         // Create instance of class ClassLinkList
    ClassLinkList newRef = new ClassLinkList(clname,shcutname,metnumber,year2,
                                       description);
    // Add to linked list;
         startRef = startRef.addRecordToLinkedList(newRef);
    // end main calling program
    class Hello extends Thread
    public int getNum()
    System.out.println("I can be ");
    return 5;
    public void rayshowName()
    System.out.println("anything i want ");
    public void rayshowName3()
    System.out.println("to be ");
    class Foo extends Thread
    public int getNum()
    System.out.println("IMHOFF");
    return 5;
    public void rayshowName()
    System.out.println("raYMOND");
    // FAMOUS PERSONS LINKED LIST EXAMPLE
    // Frans Coenen
    // Saturday 15 January 2000
    // Depaertment of Computer Science, University of Liverpool
    class ClassLinkList {
    /* FIELDS */
    public String className;
    public String shortcutName;
    public int methodNumber;
    public int yearOfDeath;
    public String occupation;
    public ClassLinkList next = null;
    public ClassLinkList linkRef5 = this;
    public ClassLinkList startRef = null;
    /* CONSTRUCTORS */
    /* FamousPerson constructor */
    public ClassLinkList(String classname, String shortcutname, int methodnumber, int year2,
                                  String description) {
         className = classname;
         shortcutName = shortcutname;
         methodNumber = methodnumber;
         yearOfDeath = year2;
         occupation = description;
         next = null;
    /* METHODS */
    /* Output famous person linked list */
    public void outputClassLinkedList()
         //public ClassLinkList outputClassLinkedList() {
         ClassLinkList linkRef = this;
         // Loop through linked list till end outputting each record in turn
    while (linkRef != null)
         //System.out.println(linkRef5);
         System.out.println(linkRef.className + ", " + linkRef.shortcutName +
                   " (" + linkRef.methodNumber + "-" + linkRef.methodNumber +
                   "): " + linkRef.occupation);
         linkRef = linkRef.next;     
    //return linkRef;
    //public String ShowCasname()
    //return String ;     
    /* Add a new record to the linked list */
    public ClassLinkList addRecordToLinkedList(ClassLinkList newRef) {
         ClassLinkList tempRef, linkRef;
         // Test if new person is to be added to start of list if so return
    if (newRef.testRecord(this) ) {
         newRef.next = this;
         return(newRef);
         // Loop through remainder of linked list
         tempRef = this;
         linkRef = this.next;
         while (linkRef != null) {
         if (newRef.testRecord(linkRef)) {
         tempRef.next = newRef;
              newRef.next = linkRef;
              return(this);
         tempRef = linkRef;
         linkRef = linkRef.next;
    // Add to end
    tempRef.next = newRef;
         return(this);
    /* Delete a record from the linked list given the first and last name. Four
    posibilities:
    1) Record to be deleted is at front of list
    2) Record to be deleted is at end of list
    3) Record to be deleted is in middle of list
    4) Record not found. */
    public ClassLinkList deleteRecord(String lName, String fName) {
    ClassLinkList tempRef, linkRef;
    // Record at start of list
    if ((this.className == lName) & (this.shortcutName == fName))
         return(this.next);
         // Loop through linked list to discover if record is in middle of list.
         tempRef = this;
    linkRef = this.next;
    while (linkRef != null) {
         if ((linkRef.className == lName) & (linkRef.shortcutName == fName)) {
    tempRef.next = linkRef.next;
    return(this);
    tempRef = linkRef;
    linkRef = linkRef.next;
    // Record at end of list, or not found
    if ((linkRef.className == lName) & (linkRef.shortcutName == fName))
                        linkRef = null;
         else System.out.println("Record: " + lName + " " + fName + " not found!");
         return(this);
    /* TEST METHODS */
    /* Test whether new record comes before existing record or not. If so return
    true, false otherwise. */
    private boolean testRecord(ClassLinkList existingRef) {
         int testResult = className.compareTo(existingRef.className);
         if (testResult < 0) return(true);
         else {
         if ((testResult == 0) & (shortcutName.compareTo(existingRef.shortcutName) < 0 ))
                             return(true);
         // Return false
         return(false);
         public void addToList(String clname, String shcutname, int metnumber, int year2,
                                  String description)
         // Create instance of class Famous Person
    ClassLinkList newRef = new ClassLinkList(clname,shcutname,metnumber,year2,
                                       description);
    // Add to linked list;
         startRef = startRef.addRecordToLinkedList(newRef);

    I have a similar problem. I am writing a program to read the class names from database and instantiate several classes which extends from ServiceThread (an abstract class extending from Thread).
    rs = pStmt.executeQuery();
    while(rs.next()) {
    String threadclassname = rs.getString("classname").trim();
    try{
    ServiceThread threadinstance = (ServiceThread)Class.forName(threadclassname).newInstance();
    }catch ...
    So far, only the first class is ever instantiated and runs fine. But subsequent classes do not even get pass the "... ... Class.forName(...).newInstance();" line.
    Funny thing is that there are also no exceptions. The JVM just seem to hang there.

  • My iPad 4 tried to open application but repeatedly iCloud asked for login with apple id password. I put my apple id password correct,even i reset it again but still it does not accept in iPad .i am bored with this 3rd class application.please help

    My iPad 4 tried to open application but repeatedly iCloud asked for login with apple id password. I put my apple id password correctly,even i reset it again but still it does not accepted in iPad .i am bored with this  class application.please help.After every 1 second icloud logoin asked.

    Find Apple ID
    https://iforgot.apple.com/applied
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    If you can’t update or restore your iOS device
    http://support.apple.com/kb/ht1808
     Cheers, Tom

  • Unsatisfied link when callind dll from run method Help Please?

    Hi,
    I get an unsatisfied link error while trying to calling a dll at a certain time period in a run method. The same dll works fine called in another setup and even called in a loop.
    Can anyone help please?
    import java.util.Timer;
    import java.util.TimerTask;
    * Schedule a task that executes once every second.
    public class TimeRetrieve {
        Timer timer;
        public TimeRetrieve() {
                 timer = new Timer();
            timer.schedule(new RemindTask(),
                        0,        //initial delay
                        1*1000);  //subsequent rate
        class RemindTask extends TimerTask
           String string_A;
           double d1;
         double d2;
         double d3;
         double d4;
         double d5;
         double d6;
         double d7;
         double d8;
         int numIter = 3;
         int start = 1;
            public void run()
                  if (numIter > 0) {
                  cinterface(start, string_A, d1, d2, d3, d4, d5, d6, d7, d8 );
              System.out.println("In Java action performed start button, after call to dll  \n");
              System.out.println("   string_A =  :" +string_A );
              System.out.println("doubles , \t  d1  \t d2  \t  d3  \t d4 \t d5 \t d6 \t d7 \t d8");
              System.out.println(d1 +"\t" +d2+"\t"+d3+"\t"+d4+"\t"+d5+"\t"+d6+"\t"+d7+"\t"+d8);
              numIter--;
                 } else
                 System.out.println("End Looping!");
                    System.exit
                 System.exit(0);  
        public static void main(String args[]) {
                   System.out.println("Starting Data Retrieval.");
                 new TimeRetrieve();
    // Load shared library which contains implementation of native methods
                    public native void cinterface(int start, String string_A, double d1, double d2, double d3, double d4,
                    double d5, double d6, double d7, double d8 );
                    static
                          try
                               System.out.println ("load cinterface"); //unsatisfied link
                               System.loadLibrary("cinterface");
                          catch (UnsatisfiedLinkError ee)
                               System.out.println
                                    ("Caught unsatisfied link error for dlls" );
                               System.out.println
                                    ("get local msg = " + ee.getLocalizedMessage() );
                               System.out.println ("getMessage " + ee.getMessage() );
                                   // System.out.println ("print Stack Trace " +ee.printStackTrace() );

    My mistake! I found it. Had some wrong names.

  • Little help please with forwarding traffic to proxy server!

    hi all, little help please with this error message
    i got this when i ran my code and requested only the home page of the google at my client side !!
    GET / HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
    Accept-Language: en-us
    UA-CPU: x86
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727)
    Host: www.google.com
    Connection: Keep-Alive
    Cookie: PREF=ID=a21457942a93fc67:TB=2:TM=1212883502:LM=1213187620:GM=1:S=H1BYeDQt9622ONKF
    HTTP/1.0 200 OK
    Cache-Control: private, max-age=0
    Date: Fri, 20 Jun 2008 22:43:15 GMT
    Expires: -1
    Content-Type: text/html; charset=UTF-8
    Content-Encoding: gzip
    Server: gws
    Content-Length: 2649
    X-Cache: MISS from linux-e6p8
    X-Cache-Lookup: MISS from linux-e6p8:3128
    Via: 1.0
    Connection: keep-alive
    GET /8SE/11?MI=32d919696b43409cb90ec369fe7aab75&LV=3.1.0.146&AG=T14050&IS=0000&TE=1&TV=tmen-us%7Cts20080620224324%7Crf0%7Csq38%7Cwi133526%7Ceuhttp%3A%2F%2Fwww.google.com%2F HTTP/1.1
    User-Agent: MSN_SL/3.1 Microsoft-Windows/5.1
    Host: g.ceipmsn.com
    HTTP/1.0 403 Forbidden
    Server: squid/2.6.STABLE5
    Date: Sat, 21 Jun 2008 01:46:26 GMT
    Content-Type: text/html
    Content-Length: 1066
    Expires: Sat, 21 Jun 2008 01:46:26 GMT
    X-Squid-Error: ERR_ACCESS_DENIED 0
    X-Cache: MISS from linux-e6p8
    X-Cache-Lookup: NONE from linux-e6p8:3128
    Via: 1.0
    Connection: close
    java.net.SocketException: Broken pipe // this is the error message
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:115)
    at java.io.DataOutputStream.writeBytes(DataOutputStream.java:259)
    at SimpleHttpHandler.run(Test77.java:61)
    at java.lang.Thread.run(Thread.java:595)
    at Test77.main(Test77.java:13)

    please could just tell me what is wrong with my code ! this is the last idea in my G.p and am havin difficulties with that cuz this is the first time dealin with java :( the purpose of my code to forward the http traffic from client to Squid server ( proxy server ) then forward the response from squid server to the clients !
    thanx a lot,
    this is my code :
    import java.io.*;
    import java.net.*;
    public class Test7 {
    public static void main(String[] args) {
    try {
    ServerSocket serverSocket = new ServerSocket(1416);
    while(true){
    System.out.println("Waiting for request");
    Socket socket = serverSocket.accept();
    new Thread(new SimpleHttpHandler(socket)).run();
    socket.close();
    catch (Exception e) {
    e.printStackTrace();
    class SimpleHttpHandler implements Runnable{
    private final static String CLRF = "\r\n";
    private Socket client;
    private DataOutputStream writer;
    private DataOutputStream writer2;
    private BufferedReader reader;
    private BufferedReader reader2;
    public SimpleHttpHandler(Socket client){
    this.client = client;
    public void run(){
    try{
    this.reader = new BufferedReader(
    new InputStreamReader(
    this.client.getInputStream()
    InetAddress ipp=InetAddress.getByName("192.168.6.29"); \\ my squid server
    System.out.println(ipp);
    StringBuffer buffer = new StringBuffer();
    Socket ss=new Socket(ipp,3128);
    this.writer= new DataOutputStream(ss.getOutputStream());
    writer.writeBytes(this.read());
    this.reader2 = new BufferedReader(
    new InputStreamReader(
    ss.getInputStream()
    this.writer2= new DataOutputStream(this.client.getOutputStream());
    writer2.writeBytes(this.read2());
    this.writer2.close();
    this.writer.close();
    this.reader.close();
    this.reader2.close();
    this.client.close();
    catch(Exception e){
    e.printStackTrace();
    private String read() throws IOException{
    String in = "";
    StringBuffer buffer = new StringBuffer();
    while(!(in = this.reader.readLine()).trim().equals("")){
    buffer.append(in + "\n");
    buffer.append(in + "\n");
    System.out.println(buffer.toString());
    return buffer.toString();
    private String read2() throws IOException{
    String in = "";
    StringBuffer buffer = new StringBuffer();
    while(!(in = this.reader2.readLine()).trim().equals("")){
    buffer.append(in + "\n");
    System.out.println(buffer.toString());
    return buffer.toString();
    Edited by: Tareq85 on Jun 20, 2008 5:22 PM

  • HELP PLEASE HELP! urgent question with an easy answer!!!!

    Hello;
    I designed a JFrame game, that uses gif files as ImageIcons. The game works perfectly when I run it from console with the java.exe command.
    However; now I want to create a wraparound and run the JFrame in the Internet Explorer from an applet. So I created a new file that extends JApplet; this new file creates a new object of the JFrame-game's class and show()'s it.
    And I created an HTM file that runs the JApplet class. However, the internet explorer cannot open the applet because it has trouble loading the pictures (gif files). How can I load the pictures from my applet for my frame???
    I dont want to change the Java security file. I just want to make the images accessible by my applet. I cannot use commands like setImage in my applet because my JFrame sets the Images.
    (I repeat)My JApplet only invokes an object of my JFrame class and shows it.
    PLEASE HELP PLEASE PLEASE..
    Thanks..

    OK; let me tell you the whole thing. My pictures are in the same folder for sure.
    My JFrame reads pictures and assigns JButtons pictures. when I run the frame there are 16 buttons with the same picture, and when I click the buttons there is a listener in the JFrame that changes the pictures. Simply put, the JFrame has no trouble finding and loading the pictures.
    Then I created a JApplet as follows:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MemoryApplet extends JApplet
    public void init ()
         GameFrame ce = new GameFrame ();
         ce.show ();
    GameFrame is the name of the JFrame class. Then when I try to open the applet using IE, it gives the following error:
    Exception: java.security.AccessControlException: (javax.io.FilePermission back.gif read)
    back.gif is one of the gif files that are used in GameFrame

  • Tomcat won't work after XP SP2 install?? help, please

    Help please!
    Hi, I installed a fresh JDK (1_5_0_02-windows-i586-p), JRE (1.5.0_01), J2EE (1.4_2005Q1), Apache web server (2.0.53-win32-x86-no_ssl) and Tomcat (5.5.7) . Everything seemed to work. I installed XP Service Pack 2 and now Tomcat won't compile JSPs. (I don't know if the SP2 install was the cause).
    The service Starts okay, but when I try to hit a jsp, Tomcat takes over my processor (at like 80%) and it starts writing to the stdout log (stdout was set to auto), repeatedly. After being up for like 20 min the log was well over 1 GB in size. It showed the below exceptions repeating ad infinitum.
    I uninstalled and reinstalled Tomcat, repaired the Apache installation (that shouldn't matter, should it?), and I am going to try reinstalling JDK/JRE/J2EE, but does anyone have any ideas of how I can fix this?
    Mar 13, 2005 9:15:13 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Mar 13, 2005 9:15:13 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 984 ms
    Mar 13, 2005 9:15:13 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Mar 13, 2005 9:15:13 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.7
    Mar 13, 2005 9:15:13 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Mar 13, 2005 9:15:14 PM org.apache.catalina.core.ApplicationContext log
    INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    Mar 13, 2005 9:15:14 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Mar 13, 2005 9:15:14 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Mar 13, 2005 9:15:15 PM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Mar 13, 2005 9:15:15 PM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Mar 13, 2005 9:15:15 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Mar 13, 2005 9:15:15 PM org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket
    SEVERE: Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] ignored exception: java.net.SocketException: select failed
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:406)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:70)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    Mar 13, 2005 9:15:15 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/32 config=null
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM org.apache.jk.common.ChannelSocket acceptConnections
    WARNING: Exception executing accept
    java.net.SocketException: select failed
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(Unknown Source)
         at java.net.ServerSocket.implAccept(Unknown Source)
         at java.net.ServerSocket.accept(Unknown Source)
         at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:295)
         at org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
         at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:849)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Mar 13, 2005 9:15:15 PM o

    Is it possible this is resulting from classpaths not
    being setup correctly? Could someone please tell me
    what my CLASSPATH and PATH enviro variables should be
    fod JDK, J2EE, JRE, etc...? Both in general and
    specifically to be found by Tomcat. They are
    installed in:
    C:\Program Files\Java\jdk1.5.0_02
    C:\Program Files\Java\jre1.5.0_02
    C:\Sun\AppServer
    Thanks!Could be.
    I think installing anything in directories whose path has spaces in it is a terrible idea. I'd reinstall the JDK to c:\SDKs or something like that.
    There's no need for a system CLASSPATH - ever. You shouldn't have one. Use -classpath when you run javac.exe and java.exe to set the CLASSPATH. Tomcat has its own class loaders. You should deploy your Web apps in WAR files - they'll have the CLASSPATH set for you that way.
    Your PATH should include the JAVA_HOME\bin.
    set JAVA_HOME=C:\SDKs
    set CATALINA_HOME=c:\Tools\Tomcat, or wherever you installed Tomcat.
    %

  • Javax.naming.LinkException: Help please

    Hi all,
    I hope one of you can help figure this out.
    I am useing WLS 7 on Win2K.
    When I try this:
    home = (ObjectIDLocalHome) ctx.lookup("ObjectIDLocalHome");
    I get this:
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException: Unable to resolve 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home' Resolved: ''
    Unresolved:'java:app' ; remaining name 'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    My weblogic-ejb-jar.xml has:
    <weblogic-enterprise-bean>
    <ejb-name>ObjectID</ejb-name>
    <entity-descriptor>
    <entity-cache>
    <cache-between-transactions>False</cache-between-transactions>
    </entity-cache>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <local-jndi-name>ObjectIDLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    And my ejb-jar.xml has:
    <entity>
    <description>Entity Bean ( CMP )</description>
    <display-name>ObjectID</display-name>
    <ejb-name>ObjectID</ejb-name>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome</local-home>
    <local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    <ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>ObjectIDBean</abstract-schema-name>
    And yes the EJB lives in gs-ejbs.jar
    When I goto the WLS console and look at the JNDI Tree I see ObjectIDLocalHome under javax.
    I hope this is just something stupid that I have over looked. HELP please.
    Brad

    Hi Guys,
    Please help me with the solution if any one got it by now ??
    Malay
    >
    Shan, have you found a solution? I'm interested in
    knowing since the same error
    is happening at my end!
    Thanks!
    "Shan" <[email protected]> wrote:
    I am facing the same problem too. Please someonesolve it.
    Thanks.
    ~Shan
    "George Job" <[email protected]> wrote:
    I too am facing the same problem. Does anyone have
    a solution to this
    problem.
    please help.
    "zollen" <[email protected]> wrote:
    I am having the same problem. I even packaged the
    ejbs and jps files
    into a web
    application archive file. It does not seems tosolve the problem. Would
    you mind
    sharing your solution??
    Brad@NoWhere wrote:
    Hi all,
    I hope one of you can help figure this out.
    I am useing WLS 7 on Win2K.
    When I try this:
    home = (ObjectIDLocalHome)
    ctx.lookup("ObjectIDLocalHome");
    I get this:
    javax.naming.LinkException: . Root exception isjavax.naming.NameNotFoundException:
    Unable to resolve'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    Resolved:
    Unresolved:'java:app' ; remaining name'java:app.ejb/gs-ejbs.jar#ObjectID/local-home'
    My weblogic-ejb-jar.xml has:
    <weblogic-enterprise-bean>
    <ejb-name>ObjectID</ejb-name>
    <entity-descriptor>
    <entity-cache>
    <cache-between-transactions>False</cache-between-tran
    sactions>
    </entity-cache>
    <persistence>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>7.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</ty
    pe-storage>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <local-jndi-name>ObjectIDLocalHome</local-jndi-name>
    </weblogic-enterprise-bean>
    And my ejb-jar.xml has:
    <entity>
    <description>Entity Bean ( CMP)</description>
    <display-name>ObjectID</display-name>
    <ejb-name>ObjectID</ejb-name>
    <local-home>com.oga.gserve.biz.oid.ObjectIDLocalHome<
    /local-home>
    ><local>com.oga.gserve.biz.oid.ObjectIDLocal</local>
    ><ejb-class>com.oga.gserve.biz.oid.ObjectIDBean</ejb-c
    lass>
    ><persistence-type>Container</persistence-type>
    ><prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>ObjectIDBean</abstract-schema-n
    ame>
    And yes the EJB lives in gs-ejbs.jar
    When I goto the WLS console and look at the JNDITree I see ObjectIDLocalHome
    under javax.
    I hope this is just something stupid that I haveover looked. HELP
    please.
    Brad

  • Servlet not inserting into Access Databse. help please

    I have the following code which is inserting three fields into a database. The database name is contacts.mdb, and the table is contacts. I have setup the ODBC connection on the server, of which I have both IIS and Tomcat running. The form.html that I am accessing is on the tomcat server root and that code is below as well. After hitting the submit button on the form I get forwarded to the servlet, and the page is blank. However, when I open the database, no updates have occured. Please help. I hope I have provided enough detail. Thanks so much.
    -------- servlet code start --------------
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class WebServlet
    extends HttpServlet {
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
    IOException {
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String sourceURL = "jdbc:odbc:terry_web_contacts";
    Connection databaseConnection = DriverManager.getConnection(sourceURL);
    Statement stmt = databaseConnection.createStatement();
    String jname = request.getParameter("Name");
    String jemail = request.getParameter("Email");
    String jcomments = request.getParameter("Comments");
    String sqlInsertString ="INSERT INTO contacts (name, email, comments) VALUES ('" + jname +"', '" jemail "', '" + jcomments + "')";
    stmt.executeUpdate(sqlInsertString);
    databaseConnection.close();
    catch(ClassNotFoundException cnfe)
    System.err.println("Error loading Driver");
    catch (SQLException sqle){
    System.err.println("SQL Error");
    ---------- servlet code end ---------------------
    ---------- html form code start ------------------
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY BGCOLOR="WHITE">
    <TABLE BORDER="2" CELLPADDING="2">
    <TR><TD WIDTH="275">
    <H2>I'm a Simple Form</H2>
    <FORM METHOD="POST" ACTION="/servlet/WebServlet">
    <p>
    <INPUT NAME="Name" TYPE="TEXT" id="Name" SIZE=30>
    </p>
    <p>
    <INPUT NAME="Email" TYPE="TEXT" id="Email" SIZE=30>
    </p>
    <p>
    <textarea name="Comments" id="Comments"></textarea>
    </p>
    <P>
    <INPUT TYPE="SUBMIT" VALUE="Click Me">
    <INPUT TYPE="RESET">
    </FORM>
    </TD></TR>
    </TABLE>
    </BODY>
    </HTML>
    ------------- html code end ------------------

    Okay, here is my modified code. However, I catch a sql error. It prints out "sql error". If I try to isolate the different lines of code with try catch blocks, the compiler says it does not recognize the symbols for example stmt, or databaseConnection. Arggh, what can I do? Help please.
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class WebServlet
        extends HttpServlet {
      public void doPost(HttpServletRequest request, HttpServletResponse response)
         throws ServletException,IOException
         PrintWriter out = response.getWriter();
         String jname = (String) request.getParameter("Name");
         String jemail = (String) request.getParameter("Email");
         String jcomments = (String) request.getParameter("Comments");
    try
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(ClassNotFoundException e)
         out.println("class error");
    try
         Connection databaseConnection = DriverManager.getConnection("jdbc:odbc:terrycontacts");
         Statement stmt = databaseConnection.createStatement();
         String sqlInsertString ="INSERT INTO contacts(name,email,comments) VALUES('"+jname+"','"+jemail+"','"+jcomments+"')";
         stmt.executeQuery(sqlInsertString);
         databaseConnection.commit();
         databaseConnection.close();
    catch(SQLException e)
         out.println("sql error");
         out.close();
    }

  • Database don't delete prom the table, help please !!

    there is my code :
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    Connection con=DriverManager.getConnection(jdbc:odbc:Medic);
    con.setReadOnly(false);
    try{
    Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    int res=st.executeUpdate("DELETE FROM PATIENT WHERE PATIEN_ID="+id+";");
    System.out.println(String.valueOf(res)+" rows deleted");
    st.close();
    }catch(Exception exc){
    System.out.print(exc+"\n");
    the code execute with no error or exception , the message that i recieve is "1 rows deleted" and i want delete just one row, it's ok until the moment but whene i read the table i see that the row is not deleted.
    I use dBase database, help please !!!
    Thanks

    Don't trust the return value.
    Because you got no exception it means that the SQL executed. SQL can execute without deleting anything however if the where clause does not match.
    As posted your code is not valid java so anything else is meaningless.

Maybe you are looking for

  • Mapping Bonus scenario for India

    Hi Experts, I want to map one Indian scenario.That is employees will get bonus through offcycle(IT267).The calculation will be Bonus WT amount will be 10% of annual Gross salary(/101).This bonus will be taxable.I have tried by creating new PCR(Y011)

  • Firefox4 not rendering HTML bordercolor attribute correctly

    Firefox 4 is not following the html specification. The bordercolor attribute seems to be ignored, resulting in many sites pages rendering in an unexpected and unwelcome 3d fashion. The question is how soon will this be fixed?

  • HT4528 one of my speakers is working, where can I get it fixed?

    I just recently received an iPhone for my birthday, in April and I just noticed that only one of the speakers on the phone is working can I get this fixed in the apple store?

  • ALV: check before delete a row

    Hi, I would like to delete a row in ALV. Before the deletion I would like to send popup with the options "OK" and  "cancel". If the user presses on cancel, it should not to be deleted. Can I catch it in ON_DATA_CHECK? Popup is not the problem. I woul

  • After Effects no longer exporting in Premiere CS4

    I use Premiere Pro CS4 to produce many short videos. I have an After Effects CS4 title that I use on all of them (some text on the bottom of the frame). In the past, I've always put the *.aep file in the Video 2 track (which also fills in the Audio 2