There is not documentation that covers Oracle UCM connectivity. You might consider online documentation about “Connecting to SQL Databases”  to begin with. It is also include a sample JSP that performs a database lookup.
Oracle UCM is another content repository. It provides APIs to check in / check out documents. It is not a relational database.
We are looking into options for using AEM as the front end with Oracle UCM as backend for storing site assets. The architecture would be similar to the following: http://dev.day.com/docs/en/crx/connectors.html
Is there any documentation how to write a connector ?
What is the use case ? You want to manage document in UCM ? Just trying to undertsand if this is worth developement effort. You can engage Adobe product team for this.