简体   繁体   中英

Facing an issue in BAM

While I am adding data source to BAM showing an error like org.postgresql.Driver

My database is PostgreSQL. I am trying to connect to that database.

Can anyone solve my problem?

You need to include Postgre JDBC driver into repository/components/lib directory in BAM server. Then you need to specify details in master-datasources.xml located in repository/conf/datasources directory. Theoretically then everything should work. But there may be some SQL syntax incompatibilities with sample toolboxes. If so you may need to change the SQL, used in both Hive scripts and dashboards.

Once you add the postgre jar to the $BAM_HOME/repository/components/lib directory as mentioned in maninda's response, you can create the data-source via wso2 management console. Go to configure -> DataSources and fill the form with the required fields. You also can add the datasource via the master-datasource.xml, which creates the datasource for in the server start-up.

Sample datasource is given below. You have to change he respective url, driver class, username and password for your postgre data-source.

<datasource>
           <name>MY_DATA_SOURCE</name>
           <description>The datasource used for analyzer data</description>
           <definition type="RDBMS">
               <configuration>
                   <url>jdbc:h2:repository/database/samples/TEST_DB;AUTO_SERVER=TRUE</url>
                   <username>root</username>
                   <password>root</password>
                   <driverClassName>org.h2.Driver</driverClassName>
                   <maxActive>50</maxActive>
                   <maxWait>60000</maxWait>
                   <testOnBorrow>true</testOnBorrow>
                   <validationQuery>SELECT 1</validationQuery>
                   <validationInterval>30000</validationInterval>
               </configuration>
           </definition>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM