Accessing public variables from other classes

Probably a simple questions, but how can I access a variable from another class. My exact situation is as follows.
A class called WorldCalender has a variable which is defined: public int hour; (the value is given to it elsewhere).
I want to access this variable and increase it by one in a subroutine in the class Hour. In this class I have put: WorldCalender.hour++; but it doesn't seem to work. How should I do it?

don't expose the hour variable at all.
have a method eg addToHourBy( int hrs )
Probably a simple questions, but how can I access a
variable from another class. My exact situation is as
follows.
A class called WorldCalender has a variable which is
defined: public int hour; (the value is given to it
elsewhere).
I want to access this variable and increase it by one
in a subroutine in the class Hour. In this class I
have put: WorldCalender.hour++; but it doesn't seem to
work. How should I do it?

Similar Messages

  • How to access variables from other class

        public boolean inIn(Person p)
            if  (name == p.name && natInsceNo == p.natInsceNo && dateOfBirth == p.dateOfBirth)
                 return true;
            else
                 return false;
        }//returns true if Person with same name/natInsceNo/dateOfBirth as phello,
    here am trying to compare the existing object with another object.
    could you please tell me how to access the variables of other class because i meet this error?
    name cannot be resolved!
    thank you!

    public class Person
        protected String name; 
        protected char gender;      //protected attributes are visible in the subclass
        protected int dateOfBirth;
        protected String address;
        protected String natInsceNo;
        protected String phoneNo;
        protected static int counter;//class variable
    //Constractor Starts, (returns a new object, may set an object's initial state)
    public Person(String nme,String addr, char sex, int howOld, String ins,String phone)
        dateOfBirth = howOld;
        gender = sex;
        name = nme;
        address = addr;
        natInsceNo = ins;
        phoneNo = phone;
        counter++;
    public class Store
        //Declaration of variables
        private Person[] list;
        private int count;
        private int maxSize;
    //constructor starts
        public Store(int max)
             list = new Person[max];//size array with parameters
             maxSize = max;
             count = 0;
        }//end of store
    //constructor ends
    //accessor starts  
        public boolean inIn(Person p)
           return (name == p.name && address == p.address && natInsceNo == p.natInsceNo);
        }//returns true if Person with same name/natInsceNo/dateOfBirth as phope it helps now!

  • Use of variables from other class

    hallo,
    i have two classes A and B
    i would like to access a variable of the class B out of A class
    without class A extends B or
    A classA = new A();
    to use
    i attempted it with a constructor
    class A{
        B klb;
        public A(B b1){
        this.klb = b1;
       int a;
       a= klb.varausB;
    }with that I get, however, a NullPointerException
    in a similar form i saw it already once and it functioned
    somebody can help me?

    that is it what I mean
    public class ClassA {
    ClassB clb;
    public ClassA (ClassB cb){
    this.clb = cb;
    public static void main(String[] args) {
    System.out.println("Var from class B:
    class B: "+clb.varb1);// there is an error, i know
    but how it is right?
    public class ClassB {
    public String varb1 ="var b1";
    }nevertheless so similarly it should function, or?So if you create an instance of ClassA, clb will be initialized. But you don't do that in main. Hence your errors:
    1) You're not calling the constructor, so clb is null
    2) You're trying to access an instance variable without having an instance, so clb is not only null, it actually doesn't exist.
    public static void main(String[] args) {
      Class A myA = new ClassA();
      System.out.println("Var from class B: "+ myA.clb.varb1);
    }You're outside of any object, ehnce you need to address clb through an instance of ClassA.

  • How to use Public variables in other classes

    Please have a look at the program.
    In the below program, i want to use the variable 'name' in the class cl_airplane1 implementation under the method aircraft to display 'BRITISH AIRWAYS' which i am passing through the object AIR1.
    The variable 'name' is declared under public section of the class cl_airplane. I do not want to use inheritance. Can i do this.
    *&             CLASS DEFINITION
    CLASS cl_airplane DEFINITION.
      PUBLIC SECTION.
        METHODS set IMPORTING  im_name TYPE string
                               im_weight TYPE i.
        METHODS display.
        DATA name TYPE string.
      PRIVATE SECTION.
        DATA weight TYPE i.
    ENDCLASS.            
    *&                   CLASS IMPLEMENTATION
    CLASS cl_airplane IMPLEMENTATION.
    *******METHOD SET*****************
      METHOD set.
        name = im_name
        weight = im_weight.
      ENDMETHOD.               
    *******METHOD DISPLAY**************
      METHOD display.
        WRITE : / ' NAME :', name, ' AND ', 'WEIGHT:', weight.
      ENDMETHOD.                   
    ENDCLASS.                   
    *&     END OF CLASS CL_AIRPLANE IMPLEMENTATION
    *&             CLASS DEFINITION-CL_AIRPLANE1
    CLASS cl_airplane1 DEFINITION .
      PUBLIC SECTION.
        METHODS : aircraft IMPORTING im_name1 TYPE string,
                  dis1.
    ENDCLASS.                   
    *&                   CLASS IMPLEMENTATION
    CLASS cl_airplane1 IMPLEMENTATION.
    *******METHOD AIRCRAFT
      METHOD aircraft.
      ENDMETHOD.                
    ********METHOD DIS1
      METHOD dis1.
      ENDMETHOD.                                         
    ENDCLASS.                 
    **********CREATING REFERENCE VARIABLES
    DATA : air TYPE REF TO cl_airplane.   
    DATA : air1 TYPE REF TO cl_airplane1. 
    START-OF-SELECTION.
    ***CREATING AN OBJECT OF THE CLASS CL_AIRPLANE
      CREATE OBJECT air .
      CALL METHOD air->set
        EXPORTING
          im_name   = 'Lufthansa'
          im_weight = '1000'.
      CALL METHOD air->display.
    ***CREATING AN OBJECT OF THE CLASS CL_AIRPLANE1
      CREATE OBJECT air1.
      CALL METHOD air1->aircraft
        EXPORTING
          im_name1 = 'BRITISH AIRWAYS'.
      CALL METHOD air1->dis1.
    <removed_by_moderator>
    Thanks.
    Edited by: Julius Bussche on Jul 30, 2008 3:13 PM

    Here is ur solution:
    *& Report  Z157780_PRG1
    REPORT  z157780_prg1.
    *& CLASS DEFINITION
    CLASS cl_airplane DEFINITION.
      PUBLIC SECTION.
        METHODS set IMPORTING im_name TYPE string
        im_weight TYPE i.
        METHODS display.
        DATA name TYPE string.
      PRIVATE SECTION.
        DATA weight TYPE i.
    ENDCLASS.                    "
    *& CLASS IMPLEMENTATION
    CLASS cl_airplane IMPLEMENTATION.
    ********METHOD SET******************
      METHOD set.
        name = im_name.
        weight = im_weight.
      ENDMETHOD.                    "set
    ********METHOD DISPLAY***************
      METHOD display.
        WRITE : / ' NAME :', name, ' AND ', 'WEIGHT:', weight.
      ENDMETHOD.                    "display
    ENDCLASS.                    "
    *& END OF CLASS CL_AIRPLANE IMPLEMENTATION
    *& CLASS DEFINITION-CL_AIRPLANE1
    CLASS cl_airplane1 DEFINITION INHERITING FROM cl_airplane.
      PUBLIC SECTION.
        METHODS : aircraft IMPORTING im_name1 TYPE string,
        dis1.
    ENDCLASS.                    "
    *& CLASS IMPLEMENTATION
    CLASS cl_airplane1 IMPLEMENTATION.
    *******METHOD AIRCRAFT
      METHOD aircraft.
        name = im_name1.
        WRITE : / ' NAME :', name.
      ENDMETHOD.                    "aircraft
    ********METHOD DIS1
      METHOD dis1.
      ENDMETHOD.                                                "dis1
    ENDCLASS.                    "
    **********CREATING REFERENCE VARIABLES
    DATA : air TYPE REF TO cl_airplane.
    DATA : air1 TYPE REF TO cl_airplane1.
    START-OF-SELECTION.
    ***CREATING AN OBJECT OF THE CLASS CL_AIRPLANE
      CREATE OBJECT air .
      CALL METHOD air->set
        EXPORTING
          im_name   = 'Lufthansa'
          im_weight = '1000'.
      CALL METHOD air->display.
    ***CREATING AN OBJECT OF THE CLASS CL_AIRPLANE1
      CREATE OBJECT air1.
      CALL METHOD air1->aircraft
        EXPORTING
          im_name1 = 'BRITISH AIRWAYS'.
      CALL METHOD air1->dis1.
    Hope That Helps
    Anirban M.

  • How to access variables from other classe through getter ?

    Hi !
    I have 10 classes
    Cau_1.java containing char Cau_1_Answer;
    Cau_2.java... Cau_2_Answer;
    Cau_10.java... Cau_10_Answer;
    and another class Resume_grammar.java with char[] AnswerList = new Char[10] used to hold cau_1_Answer, Cau_2_Answer...Cau_10_Answer.
    but I don't success to get them.
    In Cau_1.java, I do :
    private static char Cau_1_Answer;
    static char getCau_1_Answer() {
              return Cau_1_Answer;
         static void setCau_1_Answer(char cau_1_Answer) {
              Cau_1_Answer = cau_1_Answer;
    if (a.isChecked()) {Cau_1_grammar.setCau_1_Answer('a');}
    if (b.isChecked()) {Cau_1_grammar.setCau_1_Answer('b');}
    if (c.isChecked()) {Cau_1_grammar.setCau_1_Answer('c');}
    if (d.isChecked()) {Cau_1_grammar.setCau_1_Answer('d');}
    Cau_2, Cau_3...are the same way.
    in Resume_grammar.java :
         static char[] AnswerList = new char[10];     
    AnswerList[0] = Cau_1_grammar.getCau_1_Answer();
    AnswerList[9] = Cau_10_grammar.getCau_10_Answer();
    When I make AnswerList display, all is null (nothing displayed).
    Please help ! What I do wrong ?
    Thank you !

    Johnny.vn wrote:
    Cau_1 is Question_1 (Vietnamese).
    I am developing a academic test application with many question and finally display the result of the test.
    Thank you.Back to the original question: why do you need to define different classes for different questions? Do they really behave differently in a way that can't be captured by a single class?

  • Access textfield value from other class

    Hi guys,
    I got a little newbie-problem to solve.
    To say it simple I have the following code (2 classes):
    @interface class1 : UIViewController {
    IBOutlet UITextField *textField;
    @property(nonatomic, retain) UITextField *textField;
    @implementation
    @synthesize textField;
    @implementation class2
    class1 *class = [[class1 alloc] init];
    [[class textField] setText:@"text"];
    My problem is, that the text will not show up in the textfield.
    If I set the text in class1 everything works fine, but not when I try to set it from class2. The connections between the classes work well, because by using code completion it finds the textfield. I am not used to use property and synthesize, maybe thats the problem?
    Thanks for help,
    Krissi

    I'm more familiar with Mac programming and have just started playing with the iPhone SDK so I'm still trying to get my head around how iPhone apps are structured. It's a little hard to give you a definite answer without knowing more about your "class2" and how your xib file(s) are set up and perhaps which template you used to create your iPhone app.
    Assuming your xib file is named "class1.xib", it looks like the code you posted should load the xib. To check: set a breakpoint at that line, run in the debugger, once you stop at that line click the "Step over" button and see if the pointer value for your class1 variable gets updated.
    When you run your app are you even seeing the view with the text field on the screen? It may be that you've loaded the xib but you need to add it to your window. Here's a code snippet from the "MoveMeAppDelegate.m" file in Apple's "MoveMe" sample code for iPhone. This is from the "applicationDidFinishLaunching" method where the delegate object is loading a xib file and adding it to the window:
    UIViewController *aViewController = [[UIViewController alloc] initWithNibName:@"MoveMeView"
    bundle:[NSBundle mainBundle]];
    self.viewController = aViewController;
    [aViewController release];
    // Add the view controller's view as a subview of the window
    UIView *controllersView = [viewController view];
    [window addSubview:controllersView];
    [window makeKeyAndVisible];
    Hope this helps,
    Steve

  • How to access workflow variables from business classes?

    In WLI2.1 the com.bea.wlpi.server.admin.Admin bean was useful to retrieve workflow
    variables for a particular instance id.
    Is there anything similar in 8.1?
    We have to do the following:
    In the workflow, when a particular task gets created, a user (claimant of the
    task) should be able to pull the workflow xml data in a JSP. The user may update
    the data from the JSP and then the updated xml needs to be saved in the workflow.
    Then, onTaskCompleted, the updated xml will follow the rest of the workflow.
    How to do this is 8.1?
    Thanks in advance.

    Hi,
    Pls check for setRequest/setResponse in task control and setTasksRequest/setTasksResponse
    i task worker control. Hope this will resolve your issues as they have XmlObject
    as parameter.
    Regards
    Sai
    "Aparna" <[email protected]> wrote:
    >
    In WLI2.1 the com.bea.wlpi.server.admin.Admin bean was useful to retrieve
    workflow
    variables for a particular instance id.
    Is there anything similar in 8.1?
    We have to do the following:
    In the workflow, when a particular task gets created, a user (claimant
    of the
    task) should be able to pull the workflow xml data in a JSP. The user
    may update
    the data from the JSP and then the updated xml needs to be saved in the
    workflow.
    Then, onTaskCompleted, the updated xml will follow the rest of the workflow.
    How to do this is 8.1?
    Thanks in advance.

  • Handeling EventListeners given from other classes...

    Hello again,
    I got the folloing Problem:
    I've got a Frame-Class, with calls a Class from jPanel, this Panel has a button.
    My Problem is this, Is there a way, to handle the button-event from the Parent-Frame?
    Means this:
    MyPanel mp = new MyPanel();
    this.add(mp);
    // Here to wait for the button event, and do something.
    If anybody has a solution, thx alot.

    don't expose the hour variable at all.
    have a method eg addToHourBy( int hrs )
    Probably a simple questions, but how can I access a
    variable from another class. My exact situation is as
    follows.
    A class called WorldCalender has a variable which is
    defined: public int hour; (the value is given to it
    elsewhere).
    I want to access this variable and increase it by one
    in a subroutine in the class Hour. In this class I
    have put: WorldCalender.hour++; but it doesn't seem to
    work. How should I do it?

  • How to pass a variable from one class to another class?

    Hi,
    Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
    class A {
      int a;
      int doA() {
          a = a + 1;
          return a;
    class B {
      int b;
      A r = new A();
      r.a;  // error: <identifier> expected. What does that mean ?
      int doB() {
         int c = b/a;  // error: operator / cannot be applied to a
    }Thank you!

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • How to access form objects from different class?

    Hello, I am new to java and i started with netbeans 6 beta,
    when i create java form application from template i get 2 classes one ends with APP and one with VIEW,
    i put for example jTextField1 with the form designer to the form and i can manipulate it's contents easily from within it's class (let's say it is MyAppView).
    Question>
    How can i access jTextField1 value from different class that i created in the same project?
    please help. and sorry for such newbie question.
    Thanks Mike

    hmm now it says
    non static variable jTree1 can not be referenced from static context
    My code in ClasWithFormObjects is
    public static void setTreeModel (DefaultMutableTreeNode treemodel){
    jTree1.setModel(new DefaultTreeModel(treemodel));
    and in Class2 it is
    ClasWithFormObjects.setTreeModel(model);

  • Method not accessible from other classes

    Hi,
    I ve defined a class and would like to create an instance of it from another class. That works fine, I am also able to access class variables. However the class method "calcul" which is defined as following, is not accessible from other classes:
    class Server {
    static String name;
    public static void calcul (String inputS) {
    int length = inputS.length();
    for (int i = 0 ; i < length; i++) {
    System.out.println(newServer.name.charAt(i)); }
    If I create an instant of the class in the same class, the method is then available for the object.
    I am using JBuilder, so I can see, which methods and variables are available for an object. Thanks for your help

    calcul is a static method, that means you do not need an instance of server to run this method. This method is also public, but your class Server is not, your Server class is package protected. So only classes within the same package has Server can use its method. How to use the calcul method?// somewhere in the same package as the Server class
    Server.calcul( "toto" );

  • Accessing a JTextField from another class

    I 've got 2 classes I am trying to get the value of a JTextField that located in a second class see the code
    class1 myClass = new class1();
    String text = myClass.jTextField1.getText();
    System.out.print(text);What happens is when i run the program and enter some text in the jTextFild1 and then click on my Jbutton it does not print anything
    the JButton is in the caller class
    Could anyone explains to me what is wrong

    an example would help maybe....
    if you want to access your jtextfield from another class then:
    import javax.swing.*;
    public class FieldHolderClass {
    public JTextField jtf = null;
    public FieldHolder() {
      JFrame jf = new JFrame();
      jtf = new JTextField();
      jtf.setText("this is the text that is here when other callerclass seeks for text");
      jf.getContentPane().add(jtf);
      jf.setVisible(true);
    public class CallerClass {
    public static void main(String args[]) {
      FieldHolderClass fHolder = new FieldHolderClass();
      System.out.println((fHolder.jtf.getText());
    }of course i have not written any swing app for a long time, so i might have forgotten everything... so, don't flame me when that code does not compile.
    the thing that it's supposed to show, is that you make a <b>public</b> variabel (jtf) and you simply ask for it from another class by typing holderclass instances name dot and that variable name (in this case jtf) and dot and then call the method on that variable (or object...)
    it might also be that you want your code to work the way that when you enter a text into jtextfield, then after pressing enter it would get printed on terminal...
    in that case you should also register some Listeners... i remember that back when i was just getin' to know java then i had problems with it as well... but then again, i didn't read any manuals...
    i hope i was somewhat help...

  • Moving Variable from one class to another.

    I need to get a Variable from one class to another how would I do this?

    Well this is a very tipical scehario for every enterprise application. You always create logger classes that generate log files for your application, as that is the only way to track errors in your system when its in the production enviorment.
    Just create a simple class that acts as the Logger, and have a method in it that accepts a variable of the type that you are are trying to pass; most commonly a String; but can be overloaded to accept constom classes. e.g.
    class Logger
      public void log(String message)
        writeToFile("< " + new Date() + " > " + message);
      public void log(CustomClass queueEvent)
        log("queue message was: " + queueEvent.getMessage() + " at: " + queueEven.getEventTime());
    }Hope this makes things clearer
    Regards
    Omer

  • Calling a object of class from other class's function with in a package

    Hello Sir,
    I have a package.package have two classes.I want to use object of one class in function of another class of this same package.
    Like that:
    one.java
    package co;
    public class one
    private String aa="Vijay";  //something like
    }main.java:
    package co;
    import java.util.Stack;
    public class main extends Stack
    public void show(one obj)
    push(obj);
    public static void main(String args[])
    main oo=new main();
    }when I compile main class, Its not compile.
    Its give error.can not resolve symbol:
    symbol: class one
    location: class co.main
    public void show(one obj)
                              ^Please help How that compile "Calling a object of class from other class's function with in a package" beacuse I want to use this funda in an application

    kumar.vijaydahiya wrote:
    .It is set in environment variable.path=C:\bea\jdk141_02\bin;.,C:\oraclexe\app\oracle\product\10.2.0\server\bin;. command is:
    c:\Core\co\javac one.javaIts compiled already.
    c:\Core\co\javac main.javaBut it give error.
    Both java classes in co package.Okay, open a command prompt and execute these two commands:
    // to compile both classes:
    javac -cp c:\Core c:\Core\co\*.java
    // to run your main-class:
    java -cp c:\Core co.main

  • Access oracle database from different classes in desktop / standalone app.

    I am a bit confused as to what way to go. I am building a desktop application that needs to access an oracle database. I have done this in the past using code similar to the following:
            try {             DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());             Connection conn = DriverManager.getConnection(                     "jdbc:oracle:thin:@111.111.111.111:oracledb",                     "username", "password" );             // Create a Statement             Statement stmt = conn.createStatement();             ResultSet rs = stmt.executeQuery(                     "select ... from ...");             while (rs.next()) {                 ReportNumberCombo.addItem(rs.getString(1));             } // end of rs while             conn.close();         } //  end of try         catch( Exception e ) {             e.printStackTrace();         }
    The problem I would like to resolve is that I have this code all over the place in my application. I would like to have it in one objects method that i can call from other classes. I can't easily see how to do this, or maybe at this point I'm just too confused.
    I want to be able to change this connection info from a properties file which I have already done, not sure if this bit of information would change the answer to my question. I was also looking at the DataSource api, this looks like it is close to what I should use, what are your thoughts?
    I would also like to if JNDI is only for web applications or would be appropriate for a desktop app.
    Thank you for your help, I realize this is all over the place but I really need these topics cleared up!

    I have tried exactly that and am getting an error which let me to believe it couldn't be done that way. Here is my code and error message:
    public class readPropsFile {
        String getURL() throws IOException {
            // default values for properties file
            String Family = "Family:jdbc" + ":oracle:" + "thin:@";
            String Server = "Server:111.111.111.111";
            String Port = "Port:1521";
            String Host = "Host:oradb";
            String Username = "Username:username";
            String Password = "Password:password";
            try {          
                new BufferedReader(new FileReader("C:\\data\\Properties.txt"));
            } catch (FileNotFoundException filenotfound) {
                System.out.println("Error: " + filenotfound.getMessage());
                // displays to console if file DOES NOT exist
                System.out.println("The file DOES NOT exist, now creating...");
                FileWriter fileObject = null;
                fileObject = new FileWriter("c:\\data\\Properties.txt");
                BufferedWriter out = new BufferedWriter(fileObject);
                // writes to output as simple text.
                out.write(Family);
                out.newLine();
                out.write(Server);
                out.newLine();
                out.write(Port);
                out.newLine();
                out.write(Host);
                out.newLine();
                out.write(Username);
                out.newLine();
                out.write(Password);
                out.newLine();
                out.close();
            // displays to console if file exists
            System.out.println("The file exists, or was created sucessfully");
    //      creates the properties object, assigns text file.
            Properties props = new Properties();
            FileInputStream in = new FileInputStream("c:\\data\\Properties.txt");
            props.load(in);
            Family = props.getProperty("Family");
            Server = props.getProperty("Server");
            Port = props.getProperty("Port");
            Host = props.getProperty("Host");
            Username = props.getProperty("Username");
            Password = props.getProperty("Password");
    //      prints properties to a file for troubleshooting
            PrintStream s = new PrintStream("c:\\data\\list.txt");
            props.list(s);
            in.close();
            String URL = "\"" + Family + Server + ":" + Port + ":" + Host + "\"" +
                    "," + "\"" + Username + "\"" + "," + "\"" + Password + "\"";
            System.out.println("This is the URL:" + URL);
            return URL;
    }And here is where I try to call the method:
    public class connWithProps1 {
        public static void main(String[] args) {
            readPropsFile callProps = new readPropsFile();
            try {
                callProps.getURL();
                String url = callProps.getURL(); // not needed
                System.out.println("The URL (in connWithProps1) is: " + csoProps.getURL());
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                Connection conn = DriverManager.getConnection(url);
                // Create a Statement
                Statement stmt = conn.createStatement();
                ResultSet rs = stmt.executeQuery("select .... WHERE ....'");
                while (rs.next()) {
                    System.out.println(rs.getString(1));
                } // end of rs while
                conn.close();
            } catch (SQLException sqle) {
                Logger.getLogger(connWithProps1.class.getName()).log(Level.SEVERE, null, sqle);
            } catch (IOException ioe) {
                Logger.getLogger(connWithProps1.class.getName()).log(Level.SEVERE, null, ioe);
    }The error I get is:
    SEVERE: null
    java.sql.SQLException: Listener refused the connection with the following error:
    ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
    The Connection descriptor used by the client was:
    111.111.111.111:1521:oradb","username","password"
            at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
            at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
            at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:460)
            at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:411)
            at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490)
            at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
            at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
            at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)
    {code}
    Although the URL prints out correctly and when I tried plugging in the URL manually, it works just fine. One other thing I noticed was the line "The file exists, or was created sucessfully" is output 3 times.
    I will go back and change my code to properly close the resultset, thanks for catching that. Id rather use what I have instead of JNDI unless it's nesessary.
    Edited by: shadow_coder on Jun 19, 2009 2:16 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • To Generate Requirement numbers Sales Agent wise for Orders

    Hi Experts, i have small requirement searching for one BAPI for below requirement: i have one MAM order, once we go JHA2N, after you select any one item for that order, in SALES AGENT Tab, it has multiple SALES AGENTS, each sales agent can have multi

  • How to deactivate configuration of product in Opportunity

    Hi,   We are using configurable product in our project, the client wants to configure the product at Quotation only, But whent he Product is selected in Opportunity the sysytem throws an error Configure the product. Can any one suggest how to deactiv

  • Related to Inspection Characteristic load issue

    Hi All, I am trying to load inspection charatceristics  - please see my requirement below Can we use the standard SAP program for Equipment Task lists to load the Inspection Characteristics associated with the Operations? Transaction (IA01) The progr

  • Bootstarp 2  nav menu in bc(3rd level drop downs)

    Hi everyone, I am making a module V2 bootstrap nav menu in BC but i cant get the 3rd level  ITEM_1_1  and Items Item2_1_ and item  ItEM2_1_1 to open, Here's the code of the file children.html for  this. <li class="dropdown"{tag_menuitemidname_withid}

  • Execute sql command "ALTER SESSION SET..."

    How can i execute command "ALTER SESSION SET NLS_DATE_FORMAT ='MM/DD/YYYY'" with JDBC api. And by default? Bye Ste