|
At the first, you should enable java at the Sybase database.
You need do as follows, login as sa, and execute the follows command.
sp_configure "enable java"
to view whether te Sybase database have enabled java, if you see 1 in the result, it shows this server have enabled java. or else, you should do the follows steps to enable java.
sp_configure "enable java",1
Then, close and restart the Sybase database server.
|
|
In general , the user who can connect to Sybase database have most of privilege to load our embed package to Sybase database.
You can use the follows command to load package in windows command or linux shell.
In windows,
instjava -f c:/EMBSybase2Excel_WithDRV.jar' -SDBServername -Ssa -Dmydb
In Unix/Linux,
installjava -f c:/EMBSybase2Excel_WithDRV.jar' -SDBServername -Ssa -Dmydb
If errors happened when execute this command , please see the FAQ document.
After have load this package to Sybase database, you can create a JAVA procedure to execute the export operation, the follows SQL show how to create a java procedure.
create procedure exportTable(
schemaName varchar(255),
tableName varchar(255),
targetDirectory varchar(255),
targetTableName varchar(255),
targetConnPar varchar(255) )
language java parameter style java external name
'com.hxtt.data.export.advance.Sybase2Excel.exportTable(
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String,
java.lang.String)'
You can create other procedure for the other public method. All public method please see here.
Then you call this procedure like call other procedure to execute export operation.
But in the Adaptive Sybase Enterprise(ASE) database, there are some limit when use the java in the procedure. For example, you can access the file in the java procedure. So, if you want export table data to a file or import data from a file, it will throws a Exception. But you can access the network, so, you can export table data to a remote machine or import data from a remote machine, for example,
exec exportTable null, 'ATABLE','c:/data/',null,null
will throws a exception.
but,
exec exportTable null, 'ATABLE','//192.168.1.1:5252/c:/data/',null,null
can work normal if you have bought our HXTT JDBC Driver and started the HXTT server at that machine(192.168.1.1, listenered at port 5252).
In Sybase Anywhere(9.0.1 or upper), there is a configuration parameter, java_input_output, set it to ON, you can access the file.
You can see the faq if errors happen, or contact us by email, or here to submit your question.
|