Hi,

Just had in mind, that using serialization for this purpose is not very
good idea, since the serialized object can change if the definition of
e.g. AtomContainer will be changed in future.
This will result in errors when trying to read old serialized objects
with the new version of AtomContainer.

Of course if CDK freezes the implementation of core objects this will
not be an issue:)

Regards,
Nina


Javi Muriel Zafra написа:
>  
> Hi Rajarshi, I need store a molecule what come from a .mol file, but I store
> it from memory in a Molecule (or AtomContainer) object, as I said.
> So, I'll take a look about your information.
>
> Thanks again !!
>
>
> -----Mensaje original-----
> De: Rajarshi Guha [mailto:[EMAIL PROTECTED] 
> Enviado el: miércoles, 21 de noviembre de 2007 13:31
> Para: Javi Muriel Zafra
> CC: [email protected]
> Asunto: Re: [Cdk-user] Store molecules in a database
>
>
> On Nov 21, 2007, at 6:42 AM, Javi Muriel Zafra wrote:
>
>   
>> Hi.
>>
>> I'm working with molecules in an application, and I want to store them 
>> in a database. So, I would like to know how I can to store a molecule 
>> what I have in a Molecule (or AtomContainer) object. The type in which 
>> I store the molecule in the database table is a Long Row, so I need to 
>> use the method PreparedStatement.setBinaryStream (JDBC).
>>
>> To read a molecule from de db I use the following code:
>>
>> ResultSet rset = stmt.executeQuery(" .... ");
>>
>> ...
>>
>> IChemObjectReader reader = new ReaderFactory().createReader(
>>
>> rset.getBinaryStream("structure"));
>>
>> ChemObject cmol = (ChemObject) reader.read( new 
>> org.openscience.cdk.Molecule());
>>
>> IAtomContainer iaTemp = (IAtomContainer) cmol;
>>
>> I've tried to "reverse" the code to adapt for write a molecule, but 
>> I've not obtained it. Any idea??
>>     
>
> You could store molecules in a variety of ways
>
> * SMILES
> * SDF
> * a binary object (Postgres+Tigress supports this)
>
> On the hand, it looks like you want Java object serialization. See
> http://www.devx.com/tips/Tip/12439 for an example
>
> -------------------------------------------------------------------
> Rajarshi Guha  <[EMAIL PROTECTED]>
> GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04  06F7 1BB9 E634 9B87 56EE
> -------------------------------------------------------------------
>
> Q: What is a dyslexic, agnostic, insomniac?
> A: Someone who lays awake at night wondering if there really is a dog!
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Cdk-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cdk-user
>   

-- 
---------------------------------
Dr. Nina Nikolova-Jeliazkova
Institute for Parallel Processing
Bulgarian Academy of Sciences
Acad. G. Bonchev St 25-A
1113 Sofia, Bulgaria
Tel: +359 886 802011
ICQ: 10705013
www: http://ambit.acad.bg/nina
---------------------------------
PGP Public Key
http://cert.acad.bg/pgp-keys/keys/nina-nikolova-0xEEABA669.asc
        8E99 8BAD D804 1A43 27B7  7F87 CF04 C7D1 EEAB A669
---------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to