Access Amazon QLDB in Spring boot application - spring

is there a way to access Amazon QLDB as a repository in spring boot applications like MongoDB?

There isn't a library yet that integrates QLDB with spring boot.

I started to look at building exactly what you suggest, I even contacted the lead of spring data to look at adding this (I haven’t raised the ticket yet), however the CrudRepository interface provided enough integration for the demo applications that we have built with Spring Boot. One of the issues that i had when trying to create the Repository was the mapping of fields from the java objects into the partiql fields without explicit knowledge of what was changing.
QLDB does not have a jdbc driver anymore so it is now a proprietary driver which also uses partiql over sql, there could be some further issues getting this to work as a full blown repository in spring boot due to the inner reliance on sql in spring data .

Related

Teiid Spring Boot - Configuring Multiple Data Sources

I started with Teiid Spring Boot simple example from the following url:
https://github.com/teiid/teiid-spring-boot/blob/master/docs/UserGuide.adoc
It uses two different data source to demonstrate Teiid Spring Boot's capability to interact and fetch data from multiple data sources. However, when I deployed my Teiid Spring Boot component it threw exceptions related to entityManagerFactory.
One of the sites that I came across related to Spring Boot says that in order to define and use multiple data sources I need to assign one as Primary and others as Secondary Data Source, as provide on this page:
https://springframework.guru/how-to-configure-multiple-data-sources-in-a-spring-boot-application/
Can someone please confirm if my understanding is correct? If i am required to define Primary and Secondary Data Source?
I am using Spring Boot 2.2.4 and Teiid 1.3.0
Thank you!
Purnima Das
Have you seen this working example here with a single database? https://github.com/teiid/teiid-spring-boot/tree/master/samples/rdbms Teiid 1.3.0 This can be easily extended to have two databases. It only works with Spring Boot 2.1.6.RELEASE right now. No need to define the primary and secondary with this framework. Follow the example.

Spring Boot with JDO

Do we have any support for JDO in Spring Boot Release Train? I couldn't find any recent relevant material.
I am looking for OSS options that can help in creating Spring Boot applications, portable to different sort of DB Engines (RDBMS to NoSQL or vice-versa), with minimal code change, assuming no change in DB model.
DataNucleus is an open source persistence provider fully compatible with JDO/JPA APIs. You can check how to integrate it with Spring Boot in sample code here.

Developing a simple CRUD App with Spring Boot and an existing Database

Is there a way to create a simple CRUD App using Spring Boot and an Existing Database?
You could look at Spring Roo. Its entire purpose is to allow rapid application generation. There is also support for reverse engineering an app from an existing database.
Version 2 will apparently also support Spring Boot, but I don't know if database reverse engineering already made it into v2. You could always try generating your application and adding Spring Boot later on.
I haven't much used it myself so unfortunately I can't offer you much guidance on its actual use - but you should be able to find some tutorials on Google, and StackOverflow contains several questions and answers on Spring Roo as well.

Spring Hibernate Connection through AOP standalone application

I am trying to develop Annotation based Spring Hibernate standalone application to connect to DB. I've gone through the some blogs and wondered like we should not make use of hibernateTemplate becoz coupling your application tightly to the spring framework. For this reason, Spring recommends that HibernateTemplate no longer be used.Further more my requirement is changed to Spring Hibernate with AOP using Declarative Transaction management.I am new to AOP concepts. Can any one please give an example on Spring Hibernate Connection through AOP. That would be a great help to me.
Thanks in advance.
If you are looking for exemples of project structures, you may want to use maven archetypes which provide you an already working Spring + Hibernate or Spring + JPA configuration.
They may provide you also a web layer (or not) but you can remove it if you want.
To try that, install maven and type:
mvn archetype:generate
By the way, I don't think using HibernateTemplate is a big deal. Many people still use it. But you'd better inject the Hibernate session factory and use contextual sessions with getCurrentSession()
I'd use JPA instead of plain Hibernate. You can of course use Hibernate as a provider. I guess that you know how to run Spring container in standalone application. Just follow the steps from documentation here. Use LocalContainerEntityManagerFactoryBean. Then read about transaction management.
There is a new feature that lets you start JPA without persistence.xml file. Read here.
If you still want to use plain Hibernate follow the docs.

Spring Framework Saving Data to Multiple Tables

Newbie here...
I'm working on a Spring MVC app and their JDBC api for data access. How would I go about saving data to multiple tables? The insertion needs to be such that if there's an error or something goes wrong, nothing gets inserted and rolled-back. Would this be Spring's transaction support? If so, the official documentation for transaction support is very confusing to me. Does anyone have a good source for learning how to do that?
I'm using Spring 3.1, Oracle 11g, and Tomcat 6.0
Yes, spring supports transaction. You can use DataSourceTransactionManager to configure your bean.IF you find xml mapping confusing you can use annotation #Transactional. Spring's annotation support for transactions are really simple. Spring in Action book has examples for transaction management.

Resources