Home   Documentation   Demonstrations   Download

AMICO: Documentation / AMICO Modules / SQL Interface

 

A SQL database interface to AMICO. Enables usage of any JDBC or ODBC compliant database (such as MySQL, MonetDB, Oracle, SQL Server, MS Access...). Provides mapping of AMICO variables to any SQL query (INSERT, SELECT, CREATE, DROP...), and update of AMICO variables with the results of these queries.

How To Run

     java -jar %AMICO_HOME%/bin/amico-sql.jar [<conf-url>]

 


Configuration File

 

<?xml version="1.0" encoding="UTF-8"?>
 

<sql-adapter driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/Words" login="root" password="">

    <communicator host="localhost" port="3320" /> <!-- Optional. If omitted default settings will be used-->


    <sql-query type="update" trigger="translated-text" trigger-on-every-update="true">
        INSERT INTO Words (Lang1,Lang2,Phrase1,Phrase2,ContextInfo,ContextInfoType)
        VALUES ('<%=content-lang%>','<%=user-lang%>','<%=text%>','<%=translated-text%>','<%=link%>','link');

    </sql-query>

 

    <!-- type can be "select" or "update" -->


    <sql-query type="select" trigger="query-link" trigger-on-every-update="true" update-variable="translated-phrases" update-from-row="all" update-from-column-by-name="Phrase">

        SELECT concat(Phrase1, ' = ', Phrase2, '||') AS phrase, ContextInfo
        FROM Words
        WHERE ContextInfo LIKE '<%=query-link%>';

    </sql-query>
 

</sql-adapter>

 

 

Validation Logos