I am using Mobilefirst 8.0. I wanted to connect my hybrid application to DB2 database and create table in that and retrieve data from this. I just came to know after reading some documents that have to use sql adapter. but
1) how to configure and add external dependancies of JDBC driver?
2) Can I do this from my local developer server?
Please any one can guide me.
You have several questions there...
I wanted to connect my hybrid application to DB2 database and create table in that
To create a DB2 database and table in it, you need to install DB2 and create a table in it. This is not related to IBM MobileFirst. Consult the DB2 documentation.
... and retrieve data from this. I just came to know after reading some documents that have to use sql adapter.
In IBM MobileFirst Foundation 8.0 you can create either a Java adapter or a JavaScript adapter, depending on your proficiency and your project requirements.
In a Java adapter it is expected that you will create and handle the database connection as is standard in Java programming.
Read more about creating Java adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/java-adapters/
Read more about SQL in Java adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/java-adapters/java-sql-adapter/
In JavaScript adapters, MobileFirst Server takes care of many aspects, but you still need to do some minimal configurations, such as providing the database URL, and the username and password for it.
Read more about JavaScript adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/javascript-adapters/
Read more about SQL JavaScript adapters: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/javascript-adapters/js-sql-adapter/
About retrieving data and display it, etc, there are plenty of existing questions about this in Stack Overflow. Simply search for some implementation pointers.
How to configure and add external dependancies of JDBC driver
In MobileFirst Foundation 8.0 adapters are actually Maven projects. As such dependencies such as database connectors are handled via the Maven dependencies mechanism.
Learn more about adapters in general: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/
Learn how to creating adapters and adding dependencies: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/creating-adapters/
Since you're using DB2, you need to search the Maven repository for a DB2 connector and add it to your adapter's pom.xml file, then build the adapter to verify that it manages to pull the connector and that there are no compilation errors.
The example SQL adapter provided in the links above defined a connector for a MySQL database in its pom.xml. You can base your adapter on the changes made in that sample adapter.
For example:
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc</artifactId>
<version>3.8.47</version>
</dependency>
<dependency>
<groupId>com.ibm.db2.jcc</groupId>
<artifactId>db2jcc_license_cu</artifactId>
<version>3.8.47</version>
</dependency>
Can I do this from my local developer server?
This is not related to the server. It is all done in the adapter.
Related
I develop Spring Boot Rest API project using JDBC and the database is PostgreSQL. I added authorization with Keycloak. I wanna use User Federation because I would like to use Users in my PostgreSQL DB. How can I use it and other ways not to use User Federation?
I have faced the same problem recently. I have different clients with different RDBMS, so I have decided to address this problem so that I could reuse my solution across multiple clients.
I published my solution as a multi RDBMS implementation (oracle, mysql, postgresl, sqlserver) to solve simple database federation needs, supporting bcrypt and several types of hashes.
Just build and deploy this solution on keycloak and configure it through the admin console providing jdbc connection string, login, password, the required SQL queries and the type of hash used.
Feel free to clone, fork or do whatever you need to solve your issue.
GitHub repo:
https://github.com/opensingular/singular-keycloak-database-federation
I'm doing similar development but with Oracle and JSF.
I created a project with three classes:
one implementing UserStorageProvider, UserLookupProvider and CredentialInputValidator
one implementing UserStorageProviderFactory
one extending AbstractUserAdapter
Then I created another project which creates an ear file containing the jar file generated in the previous project plus the driver jar file (of PostgreSQL in your case) inside a lib folder.
Finally the ear file is copied in the /opt/jboss/keycloak/standalone/deployments/ folder of the Keycloak server and it gets autodeployed as a SPI. It's necessary to add this provider in the User federation section of the administration application of Keycloak.
I am looking for someone that can explain me in simple terms with written instructions how to create a JDBC in PostgreSQL (I am losing my mind with this). I found other answers in this page and others but I couldn't follow them.
I am no programmer, so I didn't undertand any of the instructions of how to do it in webpages and forums -the method mentioned was configuring the classpath environment variable in the command prompt but I got stuck in the command prompt, I think I have to configure the Java console or something.
I am learning some data mining and I wish to connect to some databases in order to practice. I suppose that for someone knowledgeable in this area this should be an easy job.
I prefer to install a driver in postgresql and not using a bridge.
Thanks a lot!
The phrase “how to create a JDBC” makes no sense.
You need to learn some basics first. Be clear on what JDBC is (a standard for connecting or mediating between a database and a Java app), what a JDBC driver is (a particular implementation of JDBC for a specific database.
There are four types of JDBC drivers, the Type 4 (pure Java) being most common in my experience.
For any particular database, you may find there are zero, one or more drivers implemented and available. Some are free-of-cost and open-source, some are not. For example, in Postgres there are two open source drivers, the classic one and a newer rewrite-from-scratch one, as well as some commercial products.
A JDBC driver is only useful when trying to connect a Java app to your database. That may be your own app you are writing, or a finished app you obtained such as a database-administration tool.
You must have a Java implementation installed on your computer, such as one from Oracle or from the OpenJDK project, or from another vendor such as Azul (Zing & Zulu).
You need to learn about the Java Classpath, the list of all the folders where the JVM will be looking for Java classes and JAR files. Read the Oracle Tutorial. The easiest way to go is to drop your JDBC driver JAR into an already existing folder on the Classpath, so you do not need to twiddle with setting the Classpath. For example, on a Mac you could drop your driver into /Library/Java/Extensions.
The JDBC driver sits between the database engine and the Java app. You do not install the JDBC driver into the database engine, such as your Questions mentioned, “install a driver in postgresql”.
[Postgres] ↔ [JDBC driver] ↔ [JVM] ↔ [Java app]
Basis:
PostgreSQL database with normal and reporting data
Downloaded the Mondrian zip from here
I have a client pivot grid component (DevExtreme Web)
As i understand it so far, i have to use a OLAP-server that functions as connector between MDX querys and a SQL database to provide XMLA as datasource. Therefor i want to use the Mondrian OLAP-server.
Question:
Now i need to start the Mondrian OLAP-server, connect it to the PostgreSQL database and provide a OLAP-schema.
How to start the Mondrian OLAP-server?
How to connect it to a PostgreSQL database?
How to provide a schema to the mondrian server?
And finaly, how to connect to the mondrian server?
I can't find any step by step guide or any usefull documentation of mondrian. It's all a big cloud to me.
The Problem
After many, many hours i found this thread: Github - Mondrian issue 202
The Mondrian developer, in this thread, clearly state that nearly the whole documentation is outdated and doesn't have much todo with the actual Mondrian 4 OLAP server.
They say that Mondrian 4 is no longer shiped with a deployable WAR file and the schema has big changes.
Start Mondrian OLAP Server
To get Mondrian running i downloaded this maven project that starts a mondrian server: mondrian-xmla-spike
I got everything running with the discribed derby Foodmart database.
You can either import the project as maven project in an IDE of your choice (what i did) or run mvn via. console.
Use Mondrian as XMLA provider
In the maven project you have to check all files (not many) for hardcoded paths and change them to your environment.
If you have done this, and startet the project as application, the Mondrian Server should be accessible via. a jetty server on the address http://localhost:8888/xmla
You can connect any component that can use a XMLA datasource and does support Mondrian OLAP server! The last part is very important. Mondrian doesn't comply with the MDX standard completely. Bad decision on the side of Penthao! Most OLAP-components or BI-tools only support MS SQL Server as XMLA datasource.
Connect Mondrian to PostgreSQL DB
To connect the existing maven project to a PostgreSQL DB i had to do some steps:
Update the Mondrian Version in the pom (xmla-spike.xml) file to a 4.x Version (i used 4.3.1.5-191). You can choose one from here: Penthao Mondrian Versions
Download the correct JDBC driver (for me it was JDBC42): PostgreSQL JDBC Driver and add the JDBC driver (.jar) to your project libraries
Or add the correct JDBC driver (i used 9.4.1209) from here: PostgreSQL JDBC Driver JDBC 4.1 to your maven pom (xmla-spike.xml).
Change the <DataSourceInfo> in the datasource.xml to:
Provider=mondrian;Jdbc=jdbc:postgresql://localhost:5432/default?user=postgre;JdbcDrivers=org.postgresql.Driver;Catalog=/WEB-INF/Schema.xml;
DB url: jdbc:postgresql://localhost:5432/default?user=postgre
=> jdbc:postgresql://host:port/database
Create the Schema.xml file and write a simple schema as descriped here: How to Design a Mondrian 4 Schema
You can look at the Foodmart example Schema with metamodel 4 here: Foodmart.xml metamodelVersion="4.0"
The <Catalog name="*"> must mach the schema name of the Schema.xml
This does work for me. I hope i can help someone else with this. If i forgot some steps, pls comment and i will add the missing steps.
I want to use Integrated authentication using jdbc connector in Teiid. I have tried to create a connecton to Database using:
1. Create Teiid Model Project-> Source ->Import->JDBC Connection
2. I see a feature called integrated security checkbox in Specify a Driver and Connection profile.
When i am inserting values there , it is giving me an error. I want to understand if it is supported by Teiid or not
Yes, this is supported as general JBoss EAP feature, but there is no tooling support like in the Teiid Designer as you describe above.
When you create a data source configuration for Oracle in JBoss EAP, define "security-domain", and then configure a JAAS based security domain that based on Caller Idenity Login Module. See https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Data_Services/5/html/Data_Services_Administration_Guide/chap-Login_Modules.html
Once you configure that, if Oracle source is being used as one of the sources under Teiid VDB, then the credentials used to log into Teiid will be used to issue queries on Oracle.
I was doing a project related to the IBM competition and need to create a web application. I have done a web application before by connecting netbeans and mysql. But, now am facing problem right from installation.
Is there any workbench(like something for mysql) for db2 . If so can anyone give a link. Also, I need to make jdbc connections. So, is there any other software I need to install.
Kindly explain to me in detail as I'm not pretty sure about this.
All you need is a DB2 JDBC JAR. Pick the appropriate one for your version and add it to your CLASSPATH.
You should use either a DB2 admin client to create tables and view data or something like SQL Squirrel.