Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a "NonBlockingConnectionPool "using a "java.sql.Connection" object already present ? #216

Open
ArijitCode opened this issue Dec 1, 2023 · 2 comments
Labels

Comments

@ArijitCode
Copy link

I tried creating a connectionpool using rxjava2-jdbc using a java.sql.Connection Object .

NonBlockingConnectionPool pool =
Pools.nonBlocking()
.maxPoolSize(Runtime.getRuntime().availableProcessors() * 5)
.connectionProvider(ConnectionProvider.from(connection))
.build();
But it strangely throws this NoSuchMethodError exception :

Caused by: java.lang.NoSuchMethodError: com.github.davidmoten.guavamini.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object

Scenario :-
I already have a java.sql.Connection Object , How to I use that to create a org.davidmoten.rx.jdbc.Database Object so that I can execute my SQL queries from ?

@davidmoten
Copy link
Owner

Ah, there was a breaking change in guava-mini, check you have latest version of rxjava-jdbc and other libs. If there is a mismatch I'll fix with another release.

@ArijitCode
Copy link
Author

yeah , will upgrade , but What I really would need now is this :-

I already have a java.sql.Connection Object , How to I use that to create a org.davidmoten.rx.jdbc.Database Object so that I can execute my SQL queries from ?

Can you please help me with some sample code doing specifically the above ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants