I'm new to Java but experienced with PL/SQL. I've found what appears to be
strange behaviour (a bug?) when attempting to create java stored objects
using the UNIX version of Oracle SQL*PLUS 8.1.7.3.0 with JServer 8.1.7.3.0.
The reason it seams strange is that the problem only occurs with the UNIX
version of SQL*PLUS, not the PC client version running on Windows 2000 but
connected to the same database and schema. Can anyone shed any light on
this? Details below.
The class below appears to be valid Java because it compiles without error
using the Sun JDK 1.4.
public class Mathematics {
public static long lbitand (long Number1, long Number2) {
try {
long iReturn = Number1 & Number2;
return iReturn; }
catch (Exception e) {
return -1; }
}
};
If I attempt to create this java class as a stored object in the database I
can do this using the PC client SQL*PLUS running Windows 2000 and connect to
the database running UNIX on a Sun machine. The code is:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Mathematic s" AS
public class Mathematics {
public static long lbitand (long Number1, long Number2) {
try {
long iReturn = Number1 & Number2;
return iReturn; }
catch (Exception e) {
return -1; }
}
};
I have tested this and the java works as intended in a PL/SQL application.
However, when I attempt to complile the same script using the UNIX version
of SQL*PLUS connected to the same database and schema it fails. I have
attempted to find out why it fails in the UNIX version of SQL*PLUS. When I
modify the script to attempt to isolate the problem the error messages from
the UNIX SQL*PLUS vary but appear unhelpful (for example <EOFfound where
there is no EOF). This is for code to works with the PC client version of
SQL*PLUS.
However I found some java scripts that compile in *both* the UNIX and PC
client versions of SQL*PLUS. An example of this is below:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Mathematic s" AS
public class Mathematics {
public static long lbitand (long Number1, long Number2) {
try {
return Number1 & Number2; }
catch (Exception e) {
return -1; }
}
};
Any ideas why the apparent inconsistent behaviour between the UNIX and
PC-client versions of SQL*PLUS?
Matt
strange behaviour (a bug?) when attempting to create java stored objects
using the UNIX version of Oracle SQL*PLUS 8.1.7.3.0 with JServer 8.1.7.3.0.
The reason it seams strange is that the problem only occurs with the UNIX
version of SQL*PLUS, not the PC client version running on Windows 2000 but
connected to the same database and schema. Can anyone shed any light on
this? Details below.
The class below appears to be valid Java because it compiles without error
using the Sun JDK 1.4.
public class Mathematics {
public static long lbitand (long Number1, long Number2) {
try {
long iReturn = Number1 & Number2;
return iReturn; }
catch (Exception e) {
return -1; }
}
};
If I attempt to create this java class as a stored object in the database I
can do this using the PC client SQL*PLUS running Windows 2000 and connect to
the database running UNIX on a Sun machine. The code is:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Mathematic s" AS
public class Mathematics {
public static long lbitand (long Number1, long Number2) {
try {
long iReturn = Number1 & Number2;
return iReturn; }
catch (Exception e) {
return -1; }
}
};
I have tested this and the java works as intended in a PL/SQL application.
However, when I attempt to complile the same script using the UNIX version
of SQL*PLUS connected to the same database and schema it fails. I have
attempted to find out why it fails in the UNIX version of SQL*PLUS. When I
modify the script to attempt to isolate the problem the error messages from
the UNIX SQL*PLUS vary but appear unhelpful (for example <EOFfound where
there is no EOF). This is for code to works with the PC client version of
SQL*PLUS.
However I found some java scripts that compile in *both* the UNIX and PC
client versions of SQL*PLUS. An example of this is below:
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Mathematic s" AS
public class Mathematics {
public static long lbitand (long Number1, long Number2) {
try {
return Number1 & Number2; }
catch (Exception e) {
return -1; }
}
};
Any ideas why the apparent inconsistent behaviour between the UNIX and
PC-client versions of SQL*PLUS?
Matt
Comment