Home » Developer & Programmer » JDeveloper, Java & XML » Is this right?
Is this right? [message #91975] Wed, 07 January 2004 23:00
Jeffrey
Messages: 30
Registered: January 2003
Member
I have written a java class and compiled it using JBuilder with no whatsoever errors. But when i use

loadjava -user "user"/"password"@"DB TNSname" "class location"

it loads ok into the Oracle. However when i check it in the Java classes in Oracle, it says the class is invalid. What is wrong here?

Below is a sample of my code, and BTW how do i publish it? Thanks a million :)

import java.lang.Math;

public class sdo_procedure {
public sdo_procedure() {
}
public void cal_bearing(double CoorX1,double CoorX2,double CoorY1,double CoorY2){
int XisPositive,YisPositive;
double o,a,h,x,titah;
double pi=3.142;

try{
if ((CoorY2-CoorY1)>0)
YisPositive=1;
else if ((CoorY2-CoorY1)==0)
YisPositive=0;
else
YisPositive=-1;

if ((CoorX2-CoorX1)>0)
XisPositive=1;
else if ((CoorX2-CoorX1)==0)
XisPositive=0;
else
XisPositive=-1;

if ((XisPositive==0) && (YisPositive==1))
titah=0;
else if ((XisPositive==1) && (YisPositive==0))
titah=90;
else if ((XisPositive==0) && (YisPositive==-1))
titah=180;
else if ((XisPositive==-1) && (YisPositive==0))
titah=270;
else if ((XisPositive==1) &&(YisPositive==1)){
o=CoorX2 - CoorX1;
a=CoorY2 - CoorY1;
h=Math.sqrt((a*a)+(o*o));
x=o/h;

titah=Math.tan(x/Math.sqrt(-x * x + 1));
titah=titah*(180/pi);
System.out.println(titah);
}
else if ((XisPositive==1) && (YisPositive==-1)){
o=CoorY2-CoorY1;
a=CoorX2-CoorX1;
h=Math.sqrt((a*a)+(o*o));
x=o/h;

titah=Math.tan(x/Math.sqrt(-x * x + 1));
titah=titah*(180/pi);
titah=Math.abs(titah)+90;
System.out.println(titah);
}
else if ((XisPositive==-1) && (YisPositive==-1)){
o=CoorX2 - CoorX1;
a=CoorY2 - CoorY1;
h=Math.sqrt((a*a)+(o*o));
x=o/h;

titah=Math.tan(x/Math.sqrt(-x * x + 1));
titah=titah*(180/pi);
titah=Math.abs(titah)+180;
System.out.println(titah);
}
else if ((XisPositive==-1) && (YisPositive==1)){
o=CoorY2-CoorY1;
a=CoorX2-CoorX1;
h=Math.sqrt((a*a)+(o*o));
x=o/h;

titah=Math.tan(x/Math.sqrt(-x * x + 1));
titah=titah*(180/pi);
titah=Math.abs(titah)+270;
System.out.println(titah);
}
}catch(Exception e) {
e.printStackTrace();

}

}

}
Previous Topic: run time error for oracle connection from java
Next Topic: Oracle9i - JDBC nasty problem...Please help!!!
Goto Forum:
  


Current Time: Mon Aug 02 10:47:01 CDT 2021