You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by ashkan taassob <as...@yahoo.com> on 2009/11/06 10:43:37 UTC
JDBC
Hello,
I have a question. In order to use database output in UIMA, can we give adressĀ“s database accsses (JDBC) in UIMA. for example, I want to give an adress in class "TutorialDataTime.jav" instead of this constants in line " static final String shortMonthNames = "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)"; " the output from a database access. how can I do it?
thanks a lot for your helps,
sincerely yours,
Ashkan Taassob
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
RE: JDBC
Posted by "Chavan, Girish" <ch...@upmc.edu>.
You can pass database connection parameters using the configuration parameters for your TAE. You can then read them in the initialize method using the UIMAContext variable.
String driver = (String) uimaContext.getConfigParameterValue(IFConstants.PARAM_DB_DRIVER);
String url = (String) uimaContext.getConfigParameterValue(IFConstants.IF_PARAM_DB_URL);
String userName = (String) uimaContext.getConfigParameterValue(IFConstants.PARAM_DB_USERNAME);
String password = (String) uimaContext.getConfigParameterValue(IFConstants.PARAM_DB_PASSWORD);
Class.forName(driver).newInstance();
Connection conn = DriverManager.getConnection(url, userName, password);
After this, you can initialize any of your variables with the output of a database query. I hope that answers your question.
-Girish
-----Original Message-----
From: ashkan taassob [mailto:ashkan_taassob@yahoo.com]
Sent: Friday, November 06, 2009 4:44 AM
To: uima-user@incubator.apache.org
Subject: JDBC
Hello,
I have a question. In order to use database output in UIMA, can we give adressĀ“s database accsses (JDBC) in UIMA. for example, I want to give an adress in class "TutorialDataTime.jav" instead of this constants in line " static final String shortMonthNames = "(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Sept|Oct|Nov|Dec)"; " the output from a database access. how can I do it?
thanks a lot for your helps,
sincerely yours,
Ashkan Taassob
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com