Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

sqlite import
 Post subject: sqlite import Post rating: 0   New post Posted: Wed 16 Nov, 2011, 12:37 

User rating: 0
Joined: Wed 16 Nov, 2011, 12:28
Posts: 2
Location: HU
I would like to use sqlite library (sqlitejdbc-v056.jar) in my strategy code, however I could not figure out the exact usage of @Library annotation for my case. I tried:

import org.sqlite.*;

@Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");

but I have got some strange errors:

11:12:21 ----------
11:12:21 Syntax error, insert "EnumBody" to complete EnumDeclaration
11:12:21 ^
11:12:21 @Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");
11:12:21 4. ERROR in C:\Users\DR\AppData\Local\Temp\jfxide\tmp\StrategyX.java (at line 47)
11:12:21 ----------
11:12:21 Syntax error, insert "enum Identifier" to complete EnumHeaderName
11:12:21 ^
11:12:21 @Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");
11:12:21 3. ERROR in C:\Users\DR\AppData\Local\Temp\jfxide\tmp\StrategyX.java (at line 47)
11:12:21 ----------
11:12:21 The attribute value is undefined for the annotation type Library
11:12:21 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11:12:21 @Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");
11:12:21 2. ERROR in C:\Users\DR\AppData\Local\Temp\jfxide\tmp\StrategyX.java (at line 47)
11:12:21 ----------
11:12:21 Library cannot be resolved to a type
11:12:21 ^^^^^^^
11:12:21 @Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");
11:12:21 1. ERROR in C:\Users\DR\AppData\Local\Temp\jfxide\tmp\StrategyX.java (at line 47)
11:12:21 ----------

Could anybody help me to understand better?
Thank you in advance.


 
 Post subject: Re: sqlite import Post rating: 0   New post Posted: Wed 16 Nov, 2011, 13:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Looks like you are missing an import:
import com.dukascopy.api.Library;


 
 Post subject: Re: sqlite import Post rating: 0   New post Posted: Thu 17 Nov, 2011, 05:58 

User rating: 0
Joined: Wed 16 Nov, 2011, 12:28
Posts: 2
Location: HU
Thank you for your advice.

I have added the Library import (com.dukascopy.api.Library), it is better now, but the enum error massages persist (please find them at the end).

In Eclipse (where it is working fine) it is even not imported explicitly, only it is in the built path and the following code is used (this code snippet is from an example):
Class.forName("org.sqlite.JDBC");

Which is, as far as I understand, a direct reference to the named class object.
Just for exploration, if I use this configuration in the platform, the location of the jar file, certainly, is not given (it should be a problem). At compilation time there is no error (actually it is expected), however at runtime, also without error, the sqlite calls are not working. If import the jar file using the Library annotation I have got the enum error. Where am I wrong?

I appreciate you help.

18:45:45 ----------
18:45:45 Syntax error, insert "EnumBody" to complete EnumDeclaration
18:45:45 ^18:45:45 @Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");
18:45:45 2. ERROR in C:\Users\DR\AppData\Local\Temp\jfxide\tmp\StrategyX.java (at line 48)
18:45:45 ----------
18:45:45 Syntax error, insert "enum Identifier" to complete EnumHeaderName
18:45:45 ^18:45:45 @Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar");
18:45:45 1. ERROR in C:\Users\DR\AppData\Local\Temp\jfxide\tmp\StrategyX.java (at line 48)18:45:45 ----------


 
 Post subject: Re: sqlite import Post rating: 0   New post Posted: Thu 17 Nov, 2011, 16:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You have to make sure that the jar file knows where its dependencies are, by doing one of the two:
1) include all necessary jars in the annotation, for example:
@Library("c:\\Users\\sqlitejdbc\\sqlitejdbc-v056.jar;c:\\Users\\sqlitejdbc\\dependency1.jar;c:\\Users\\sqlitejdbc\\dependency2.jar");
2) Include the dependency directory in system classpath.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com