Gary Labowitz

Greenhorn
+ Follow
since Aug 18, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gary Labowitz

If you have digested my previous post I will now add:
You can force a String that is created at runtime to reference a String in the literal pool if one already exists for that String value by using the intern method of String class.
So, code like
String str4 = str2 + str3; //creates a new String with
//"Java" in it
str4 = str4.intern( ); //changes the reference in str4
//to the String "Java" in the
//literal pool
will create a String with "Java" in it (str4) and then change that reference (str4) to the address of the String "Java" in the literal pool.
Now str1 == str4 will evaluate to true.
When the compiler creates String's, it puts them into a literal pool. This is managed by Java. If, at compile time, a String is already in the pool Java reuses that copy of the String instead of creating another one containing the same data. (Since String's are immutable, a given String will always contain the same data during its lifetime.)
The expression "Ja" + "va" is evaluated at compile time to "Java" which is already in the literal pool. Therefore, the same String in the pool is used for both the expressions "Java" and "Ja" + "va". The address of that literal pool String is what is being compared in the expression str1 == "Ja" + "va".
On the other hand the three String's str1, str2, str3 in your second example create three String's in the literal pool. One contains "Java", the second contains "Ja", and the third contains "va". At runtime (not compile time) the expression str2 + str3 creates a fourth String variable containing "Java". Even though str1 and the new (temporary) String contain "Java" as their data, the addresses of these two String's are different. So str1 == [the new String containing "Java"] is false.
In your compile of Esfera you have a package statement for pacquete1. The compiler tries to find the reference to Circulo by adding the package name to it (pacquete1.Circulo) and does not find it since Circulo is in pacquete.
You tell the compiler to try adding pacquete to the name of any class in your code by using an import statement:
import pacquete.*;
This will allow the compiler to find Circulo in the pacquete directory. (It will be looking for the class named pacquete.Circulo, which is the actual class name.)
20 years ago
Use CONCUR_UPDATABLE constant in the createStatement() method. This is only since 1.2, so if you are using the jdbc/odbc driver from 1.1x you are out of luck.
BTW, you don't even need a DSN; just use
url = "jdbc dbc:MS Access Database;DBQ=path-to-database"
Gary
You are looking for getMoreResults( ) method of the ResultSet Interface.