Sandy Lee

Greenhorn
+ Follow
since Jan 18, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sandy Lee

Hello All,
I am trying to connect to Oracle database on a remote server.
I am using j2ee reference implementation from Sun.
I have set the following:
J2EE_CLASSPATH to include classes111.zip.
Added the following entries to the resources.properties file.
jdbcXADataSource.6.name=jdbc/CRDEV
jdbcXADataSource.6.url=jdbc racle:thin:@Server:1521:dbName
jdbcXADataSource.6.classname=oracle.jdbc.driver.OracleDriver
jdbcDriver.6.name=jdbc.oracle.driver.OracleDriver
jdbcXADataSource.6.dbpassword=user
jdbcXADataSource.6.dbuser=user1
When I start the j2ee server, I am getting a message which says that the index 6 is invalid.
Can someone help?
Thanks.
Sundeep.
Pankaj,
Also, you need not necessarily use ant to compile the source files.
I am using Oracle 8.0 on a remote machine.
The application server being used is the j2ee reference implementation downloaded from Sun.
I feel that I am not specifying the name values pairs rightin the resource.properties file. Am pretty sure that there is no problem with class paths.
Thanks for your help!
Hello All,
I am trying to connect to a Oracle database on a remote machine using a thing oracle driver without much success.
I understand that the resource.properties files need to be modified.
I am not successful with the above.
Can someone help me?!
Thanks for your help!!

When will the variable Str be eligible for garbage collection.
public class MyClass{
public static void main(String[] args({
String s = "AString";
s = null; // Line 1
}// Line 2
At line 1 or line 2.
I thought it should be line 1.
But as per the Sun exam, it is at line 2 after the method call ends.

Any explainations.
Thanks.

}
Actually here is why:
String name;
String newname = "Nick";
newname = "Jason";
/* The object "Nick" can no longerbe referenced.(No variable pointing to "Nick" string as newname now points to "Jason")
Therefore at this point one String object eligible for GC-- "Nick". */
name = "Frieda";
String newestName = name;
/* After the above statement, two handles point to the same object. Both newestName and name variables point to the String "Freida". */
name = null;
/* In the above stmt, the name variable no longer points to the STring "Freida". But the newestName continues to point to the String " Freida" */
// Therefore, only one object is eligible for garbage collection.
//and that is " Nick".
In very simple terms, checked exception are a subset of the exceptions that are checked by the compiler and flagged(code will not compile) if they are not handled by the method
1. either in a try catch block or
2. not propogated by that method by declaring the method as throws SomeChecked excpetion.
Of the Exception class, there is the RunTimeException subclass and its sub classes and there are other subclasses.The RuntimeException and its subclasses are not checked exceptions.

The other exceptions include IOException and its subclasses for e.g.
A simpler way to remember is that all Exception other than
1. Exception class.
2. RuntimeException and its subclasses
are checked exception.
Trust this helps.
Manfred,
I would say, that is not entirely true.
Try casting say ClassA to say another class say ClassA where in both are separate classes defined by the programmer.
It will not compile.
Thanks all of you for your answers.
Can any one explain how this compiles:
COnsider the following classes/interfaces
interface Intf10{}
class Base1010 implements Intf10{}

Base1010 b10 = new Base1010();
Runnable r2 =(Runnable)b10; <--- How does this compile

Also, this
Object 0 = new Object()
Runnable r3 =(Runnable)0;
My understanding is that since both Base1010 abd Object do not implement the Runnable interface at all, they should not compile.
But it does.It was a different question if the interface handle
was Intf10.
I know that there will definitely be a runtime exception. But why no compile time ?
Any explaination.
Thanks.

This because array is a object. You are passing a reference to the Array object and then modifying its value.
Had it just been an int and not an array of int, then you would see the results you are looking for.
That is not change in value.
I thing true, false and null are not keywords.
They are literals.
Thanks Udayan.
I get it now.
Sandy.
Its the way the two assignments work:
When you use c += b, behind the scenes, this is what is actually happening (char)(c+b).
So the casting is taken care by JVM for you.
However in the first case, you are adding a char and a byte. This will return an int which who are assigning to a char variable. causing it to complain.
Trust this helps.
Hi! All can anyone explain how
- 5 << 29 is giving a positive number of 1610612736
Is << not a signed left shift and should therefore give a
negative number?
I am not able to manually determine th above result.
Can anyone please explain??!!