Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> call java class in pl*sql

call java class in pl*sql

From: h <heba11282_at_yahoo.com>
Date: 3 Feb 2005 08:34:10 -0800
Message-ID: <1107448450.808797.171030@z14g2000cwz.googlegroups.com>


HI,

"i want to create file .xls from pl*sql but i don't want it ­to be in slk or csv format as i want to 've rows with background colo­r & these

fromats doesn't support this "

& i got some help from OTN dbforum
" With just pl/sql you cannot create xls files. You can use ­Java. Here
you can find some demo's:
http://www.andykhan.com/jexcelapi/ "

then i do this

THIS IS MY CLASS WHICH CALL jexcel API jar :

package ExcelGenPackage;

import java.io.File;
import java.io.IOException;
import java.lang.Number;
import java.util.Date;

import jxl.*;
import jxl.write.*;

public class ExcelGenClass
{

public ExcelGenClass()
{

}

/**

*
* @param args
*/

public static void main(String[] args)
{

ExcelGenClass excelGenClass = new ExcelGenClass(); Write_XLS();

}

public static void Write_XLS()
{

try
{

WritableWorkbook workbook = Workbook.createWorkbook(new File("C:\\output.xls"));
WritableSheet sheet = workbook.createSheet("First Sheet", 0)­; Label label = new Label(0, 2, "A label record"); sheet.addCell(label);

Label label1 = new Label(0, 4, "A Second label record "); sheet.addCell(label1);

// All sheets and cells added. Now write out the workbook workbook.write();
workbook.close();

}

catch (JXLException e)
{

System.out.println("JXLException ");

}

catch (IOException e)
{

System.out.println("IOException ");

}
}
}


I Load the jar & the class into pl*sql
then i add wrapped procedure

PROCEDURE Test_Proc AS LANGUAGE JAVA
NAME 'ExcelGenPackage.ExcelGenClass.Write_XLS()';

when i call Test_Proc
i got this exception

ORA-29532: Java call terminated by uncaught Java exception: java.lang.IncompatibleClassChangeError: Error detected by by­tecode verifier when class was created

please help Received on Thu Feb 03 2005 - 10:34:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US