From the course: Learning Quarkus

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Solution: Data access

Solution: Data access

From the course: Learning Quarkus

Start my 1-month free trial

Solution: Data access

(music) - So now it's time for my solution to this challenge, and I've actually implemented for both the Postgres database and the Cassandra database, so you'll have both of those available to you in the exercise files. Let's start with the Cassandra version. So what I've done is in SRC/main/resources, application of properties, I've put a "bedInfo" property. And in this case, I'm passing 1K. Now in SRC/main/Java, in the runner class... I've added a few things here. So on line 31, you'll see that I create a CQL statement but I have a bind variable in there. So I'm setting that bedInfo equal to question mark. This is good practice, obviously it helps you prevent against some CQL injections when you start doing things like using them. So then I create an array list, and then I do a prepared statement because this is now a prepared statement as opposed to just a regular statement. Once I do that, I have to create a…

Contents