473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Inconsistent behaviour creating java stored objects using sqlplus in Oracle 8i

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 "Mathematics" 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 <EOF> found 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 "Mathematics" 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
Jul 19 '05 #1
2 5718
"Matt" <no*@this.address.com> wrote in message news:<40**********************@news.optusnet.com.a u>...
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 "Mathematics" 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 <EOF> found 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 "Mathematics" 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


it may have something to do with sqlplus wanting to use the & for
variable substitution. try issuing a

set scan off

in sqlplus before executing the create or replace java source ...
statement.
Jul 19 '05 #2

"bung ho" <bu*****@hotmail.com> wrote in message
news:56*************************@posting.google.co m...
"Matt" <no*@this.address.com> wrote in message

news:<40**********************@news.optusnet.com.a u>...
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 "Mathematics" 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 <EOF> found 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 "Mathematics" 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


it may have something to do with sqlplus wanting to use the & for
variable substitution. try issuing a

set scan off

in sqlplus before executing the create or replace java source ...
statement.


I already had issued 'set scan off', but thanks for the suggestion.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: wallflowers | last post by:
Hi, I would like to know , how do I compile an oracle stored procedure or trigger from Visual C++ environment. I entered the sqlplus username/password@dbstring @filename command in the Custom...
6
by: Dim St Thomas | last post by:
I am a developer working on a database client program. I am testing this program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk) This machine has Oracle 9.2.0.1.0 and RedBrick...
2
by: Suresh Tri | last post by:
Hi all, I am interested in extracting the class or jar files which are stored as java stored procedures in Oracle. But I want to know if these are stored as references to external files in...
14
by: Tony | last post by:
Can someone a little more clever than I (which means just about anyone on this list) tell me what the implications/benefits are of this are please? ...
2
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I can successfully insert and update the oracle database by calling a oracles stored proc from my .net code. This oracle stored proc is returning some value. I cannot see that...
1
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I can successfully insert and update the oracle database by calling a oracles stored proc from my .net code. This oracle stored proc is returning some value. I cannot see that...
26
by: seemagoyal | last post by:
Hi, I don't have any experiance of UNIX and oracle. but i have got a short assignment for writing a unix script that will call a stored procedure. this script has to run this procedure after...
0
by: Mark D Powell | last post by:
getamit23@rediffmail.com (Amit Kapoor) wrote in message news:<c33bca54.0307090046.7698321f@posting.google.com>... The Windows version of sqlplus should be part of the Oracle client install for...
2
by: Matt | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.