Problem with logging in via database

I am trying to read users from our storage and am using the following code copied from the docs

  private DataSource dataSource;

  protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    // Configure users and roles in a JDBC database
        "SELECT username, password, enabled FROM users WHERE username=?")
        "SELECT username, role FROM role WHERE username=?")
      .passwordEncoder(new BCryptPasswordEncoder());

I have the users and role tables in my database but can’t get them to communicate with this function

My terminal gives this error and seeing as how the docs are fairly limited on this subject, i can’t get it to work.

EDIT: fixed type in original post with ?

The exception does not match your code. Are you sure that this is the code that runs?

In the exception the query does not have a ? placeholder but the value ‘admin’

oh sorry i tried running it with admin but yes, this is the code that runs

it also does not work with ?

Can you please run it again and post the whole stacktrace as text not as image

I am not getting error messages anymore but i still cant login (with correct login data that is in my database)

Are you sure that the password in the DB is encrypted with Bcrypt`?

Welp might be that, ill try that later

my passwords are currently in plain text, what encoder should i use for this?

^ is not needed anymore

it is fixed, thanks for the help @adaptable-uakari