java - Add Charsetprovider to the OJVM -
i need add new charsetprovider ojvm inside oracle 12c database.
i load class loadjava :
loadjava -v -u user mynewcharsetproviderclass.jar
my class go in oracle schema, direct method work. charsetprovider part not load serviceloader.
in pure java add in meta-inf/services , serviceloader load in oracle database java vm seem not work way. charsetprovider class not load. class work fine in pure java, use many years ago.
meta-inf/services : java.nio.charset.spi.charsetprovider content :
com.eric.newcharset.nio.charset.spi.newcharsetcharsetprovider
code example inside database :
create or replace , compile java source named "myjavadbprocedure" public class myjavadbprocedure { public static string upcase(string text) { string str; try { str = new string("ééeeaarrr".getbytes("windows-1252"), "newcharset"); } catch (exception ex) { return ex.tostring(); } return str; } };
when call it, t have java.io.unsupportedencodingexception : newcharset.
Comments
Post a Comment