Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Problems Creating Java Source Through ODBC... ORA-29542
Hi,
I need to create a program that sets up the necessary server code
in the database by running various scripts. It now works for all
objects
except JAVA SOURCE objects.
The following sample code in VFP/VB
lcsql='create or replace and compile java source named
DeleteFile'+chr(10) lcsql=lcsql+'as'+chr(10) lcsql=lcsql+'import java.io.*;'+chr(10) lcsql=lcsql+'public class DeleteFile'+chr(10) lcsql=lcsql+' {'+chr(10) lcsql=lcsql+' public static void DoDelete(String FilePath) throwsException'+chr(10)
lcsql=lcsql+' {'+chr(10) lcsql=lcsql+' File NewFile = new File(FilePath);'+chr(10) lcsql=lcsql+' NewFile.delete();'+chr(10) lcsql=lcsql+' }'+chr(10) lcsql=lcsql+' }'+chr(10)
lnerror=SQLEXEC(h,lcsql)
IF lnerror=-1
?MESSAGE()
ENDIF
Give the error:
Connectivity error: [Oracle][ODBC][Ora]ORA-29542: class DeleteFile
already defined by source DeleteFile
However, Running the same code in sqlplus:
SQL> create or replace and compile java source named "DeleteFile"
2 as
3 import java.io.*;
4
5 public class DeleteFile 6 { 7 public static void DoDelete(String FilePath) throws Exception 8 { 9 //Delete FilePath 10 File NewFile = new File(FilePath); 11 NewFile.delete(); 12 }
Java created.
Works fine...
I'm a little confused about the error message and confess I cant seem to figure out how to find this "already defined source"?
Does anyone have any ideas here? Received on Sat Jul 05 2003 - 05:22:53 CDT
![]() |
![]() |