teiid / teiid-spring-boot

Teiid Spring Boot is fast way to get to your Data Virtualizations projects using Teiid and Spring Boot
https://teiid.io
Apache License 2.0
46 stars 63 forks source link

WrappedConnection class in Teiid boot #317

Closed cgokulnath closed 3 years ago

cgokulnath commented 3 years ago

For reading large blob objects, we like to use WrappedConnection object in Teiid boot framework. Is this support available.

rareddy commented 3 years ago

Typically in SpringBoot you use JdbcTemplate like

    @Autowired
    JdbcTemplate template;

into your bean and then use it. However, if you want a connection then you need to

((WrappedConnection)template.getDataSource().getConnection()).unwrap()

However, I am not sure if the above is the right level of unwrapping as this will take you away from pooling concepts etc. Direct usage of connection is not suitable for Spring Boot apps.

If you are using a remote client (a separate client app connecting to your teiid spring boot app) then you can just connect using TeiidDriver as you might have done when using Teiid with WildFly. There you can unwrap and use the way you need to.