dbTalk Databases Forums  

Problems Creating Java Source Through ODBC... ORA-29542

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Problems Creating Java Source Through ODBC... ORA-29542 in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TimMcConechy
 
Posts: n/a

Default Problems Creating Java Source Through ODBC... ORA-29542 - 07-05-2003 , 05:22 AM






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) throws
Exception'+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)
**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 }
13 }
14 /

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?

Reply With Quote
  #2  
Old   
Sybrand Bakker
 
Posts: n/a

Default Re: Problems Creating Java Source Through ODBC... ORA-29542 - 07-05-2003 , 11:34 AM






On 5 Jul 2003 03:22:53 -0700, tjm (AT) runtime (DOT) dk (TimMcConechy) wrote:

Quote:
Does anyone have any ideas here?

Use a proper development environment. Do not use ODBC when you can use
sql*plus. Do NOT allow end-users to misuse ODBC to create any object
on the fly


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address


Reply With Quote
  #3  
Old   
TimMcConechy
 
Posts: n/a

Default Re: Problems Creating Java Source Through ODBC... ORA-29542 - 07-09-2003 , 09:27 AM



Thanks for the reply..

The purpose of this part of the application is to run scripts
I know sqlplus can do this but the boss wants it in this application.
I understand your point and will take it under advisment.
Any reason for this position? (I understand the security
consequences).

Can SQLPLUS by made to run in silent mode?

Programs like Toad seem to be able to run it and I dont see you
complaining to them about not using sqlplus.

If anyone has any ideas about the original problem I would still
appreciate it.

BR
Tim

Quote:
Use a proper development environment. Do not use ODBC when you can use
sql*plus. Do NOT allow end-users to misuse ODBC to create any object
on the fly


Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.