How to write from Xpages to PostgreSql database? - postgresql

I have to create an Xpage web application which directly inputs data in a PostgreSql database. I've never worked with a PostgreSql database so I have absolutely no idea on how to approach this.
The application will be used through a browser if that matters.
Any help would be highly appreciated.

or, if you do not want to use the extLib for this purpose only, take a look at http://www.eknori.de/2011-07-03/using-mysql-data-in-xpages/ The article describes, how to access MySQL, but you can use the same code even for PstGreSQL with the correct JDBC drive.
The article also contains a link to OpenNTF where you can download the full source code.

You need to use a JDBC connection to connect to PostgreSQL. Use the extension library. This library contains a demo application which connects to a sql database using JDBC. Please take a look at this question : How do I access SQL from XPages.

Related

Postgresql in Node-red

I use node-red to create an Api from a server. I want to read and send data via http. I use the browser-based programming method. I want to send data from a postgresql database. I installed the package node-red-contrib-postgres-multi. I donĀ“t know how to put data into the database and how to read data from the database, because I cannot find examples.
Does anybody knows, how I can do that?
You can use postgrestor postgrestor package where you can define query or data modification statement directly in node window. It also allows parametrized queries via template engine.
The problem I've encountered is working with more than one db instance in the same flow but if you need only one db instance connection it should work for you.

Load a PostgreSQL database using cloudconnect

On the side of my Gooddata project, I maintain a small PostgreSQL database that contains a few tables.
I would like to be able to integrate both my ETL processes using the same tool, and it seems to me cloudconnect would be the easiest way, since I already have my whole GoodData ETL in it.
Here are the ways I tried to do it without success:
I tried to have a look in the documentation, and it seems to me that all the functionalities of CloverETL that enabled this (DBOutput, PostGreSQLDataWriter) are not available in Cloudconnect.
I managed to connect to the Agile Datawarehouse Service (Database attached to GoodData), but it seems that only the ADS database is able to understand the request:
COPY MyDataBaseTable (field1,field2) FROM LOCAL '${DATA_TMP_DIR}/CIforADS.csv'
even when I adapt the syntax to PostgreSQL because the dynamic addressing I use here does not seem to work.
Is there any way to proceed that I'm missing? Can anyone think of a workaround?
In general this could be achieved by using of "DBExecute" component, but
I'm not sure if I understand it well - do you want to load data into your own Postgres instance using CloudConnect?

Connect to an ADO.NET database using ODBC

We have a bespoke column based database which we access progamatically using its ADO.NET driver which we wrote in-house. However a colleague wants to use Excel etc to access this database using ODBC.
I expected to find some form of connector to provide an ODBC connection over an ADO.NET datasource (or some config in the ODBC) but I can't find anything.
I know this is using a new tech to connect to a much older one, but its what they want! So if anybody knows of a way to do this it would be much appreciated.
Cheers
John
Sounds like you've created a ADO.NET driver first, as opposed to an ODBC driver first. This sounds a little crazy as everyone knows you can access ODBC driver from ADO/NET but not the other way round.
ODBC is actually a much better interface and used by far more applications, is you question actually correct??

TideSDK - postgreSQL?

is there a way to connect to a postgreSQL Database? I've noticed that the PHP module doesn't have the postgres extensions and its not possible to load it dynamically.
Is there any other way? An external PHP scripts will be the worst solution.
Alex
I don't have direct experience with Tide, but reviewing their docs here are the places I would look:
Javascript-> PostgreSQL Is there a possibility of connecting postgreSQL directly to Javascript?
Python -> PostgreSQL, like psychopg.
If that fails, along with other similar languages, MAY be able to find another driver written fully in a language like this.
The PostgreSQL protocol is extensively documented and several implementations exist for it. You could probably adapt either the Javascript driver or implement in another language to give you a direct driver to PostgreSQL http://www.postgresql.org/docs/9.1/static/protocol-flow.html

Connecting to a MySQL database using Xcode and Objective-C

I have been interested in working with a MySQL database in my iPhone or Mac projects. How is a connection performed in Objective-C?
I only had a bit of experience with PHP, but heck, that is a bit too different =/
Check this tutorial for connectivity with SQLite.
You will not be able to connect to MySQL directly from the iPhone. You must use some intermediate layer such as a Web application with PHP.
So, you will have something like this:
iPhone POSTING a request to the WebServer using HTTP
Web Server connecting to the MySQL database
Web Server returning data to the iPhone (XML, plain text)
iPhone processing the data
You can use this technique to query and insert/update/delete data.
Once I found this library for MySQL, and I am aware how it works.
It's a much better option not to deal directly with MySQL, but use Apple's Core Data API.
It allows you to manage an relational database without having to write SQL. It's very fast, very useful. Good stuff.
Try absrd which recycles connections across concurrent threads (queues).
If you want to connect to a MySQL database, use MySQL's Connector/C API library which, as Objective-C is a strict superset of C, you can use without any issues. I helped someone with the installation of it here.