Regarding connection class in RethinkDb

57 Views Asked by At

I am not able to understand why am I getting this error stating that connection of type Connection is not initialized if anyone could help me out with it.

enter image description here

1

There are 1 best solutions below

0
BabC On BEST ANSWER

In your main method, you are writing

Connection connection; // connection is still null
UserService sut = UserService(r, connection);

But as you error message said : you cannot instantiate UserService with a connection variable that is null. You must rework your code so your variable won't be null when you initialize the UserService