Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> call java class in pl*sql
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 color & 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;
public class ExcelGenClass
{
public ExcelGenClass()
{
}
/**
* * @param args */
}
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 bytecode verifier when class was created
please help Received on Thu Feb 03 2005 - 10:34:10 CST
![]() |
![]() |