home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,295 of 2,288   
   Matt to bung ho   
   Re: Inconsistent behaviour creating java   
   16 Apr 04 12:23:56   
   
   From: not@this.address.com   
      
   "bung ho"  wrote in message   
   news:567a1b1.0404151047.75564364@posting.google.com...   
   > "Matt"  wrote in message   
   news:<407e1036$0$4543$afc38c87@news.optusnet.com.au>...   
   > > 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  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.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca