User acb578c1ac
15-07-2008 13:28:26
Hi,
is it possible to include JChem or required java-files in Oracle to create a IUPAC-Name by a given structure at oracle side? And what are the first steps to do it?
thanks in advanced!
ChemAxon a3d59b832c
15-07-2008 16:14:54
User acb578c1ac
17-07-2008 09:02:15
Hi,
thanx for fast answering and step by step examples! But i assumed that is quite easier to implement without using GUI and Cartridges. Is it possible to only add an external java source an wrap these java functions in plsql-packages to get an iupac-name by given structure in sdf-format : for example? Because we have higher restricions on cusomers databases, so we prefer a simple solution for generating iupac-names. is there any way?
thanks in advanced!
User acb578c1ac
17-07-2008 14:48:28
hi,
code-sample looks great, thanx!
I created this compilable java-source
Code: |
create or replace and compile java source named MolConvert as
import java.io.ByteArrayOutputStream;
import java.io.ByteArrayInputStream;
import chemaxon.formats.MolConverter;
public class MolConvertClass
{
public static String molconvert(String structure, String[] options)
throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ByteArrayInputStream bais = new ByteArrayInputStream(structure.getBytes());
String[] args = options;
MolConverter mc =
MolConverter.createMolConverter(bais, baos, args, null, null);
try {
if (mc != null) {
mc.convert();
}
} catch (java.lang.InternalError ie) {
if (ie.getMessage().indexOf("X11") != -1) {
throw new RuntimeException("To enable image generation, set the system property 'java.awt.headless' to 'true'");
}
}
return new String(baos.toByteArray());
}
}
|
a corresponding wrapper...
Code: |
function convert(pSDF varchar2,
pOptions varchar2) return varchar2 as
language java name 'MolConvertClass.molconvert(java.lang.String, java.lang.String[])return java.lang.String';
|
and a calling function...
Code: |
function GetIUPAC return varchar2 is
vSDF varchar2(32000);
vIUPAC varchar2(500);
begin
select sdf
into vSDF
from molecule;
vIUPAC := convert(vSDF,???);
return(vIUPAC);
end;
|
There are several bugs already in there.. I gues the interfaces does not mach correctly and i'am unsure about the second parameter (options (args))!!
I hope you can help to make this code runable..
thanks in advanced!
ChemAxon aa7c50abf8
17-07-2008 15:42:51
If you're just after IUPAC names, then you can simply remove the second argument from both wrappers and create the MolConverter instance in the Java wrapper like this:
Code: |
MolConverter mc =
MolConverter.createMolConverter(bais, baos, new String[] {"name"}, null, null); |
User acb578c1ac
18-07-2008 07:38:03
good morning,
thanks for the last code file.. looks now very good. but now i get an exception that i need a licens file to test it. i send a request to your technical support forum. hope, they can help
the aim is near! well done pkovacs!!
____ ___ ___ ___ _____
|| T ||| H ||| A ||| N ||| X ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|
ChemAxon 0815c054e1
18-07-2008 09:01:38
Dear Andre,
You can ask for a free 30 days evaluaiton license for any of ChemAxon products.
Please send an email about your request to
sales _at_ chemaxon.com. and we will get back to you.
BR,
Norci