Question

Why can't I select my table with Spring Boot?

I’m working in an API that access the database to return a String based on an input. I’m using Spring Boot with JDBC to connect a MySQL server at localhost.

I’ve already tested the app in several different systems and it works fine, but when I test it at my droplet the query returns nothing.

I am certain that it connects and there the database is populated. If I use the same query at the mysql terminal it returns the data.

The app returns java.lang.ArrayIndexOutOfBoundsException: 2553 exception when it tries to select the table and prints

 MySQL data: []

2017-11-16 14:06:56.321  INFO 21565 --- [       Thread-4] ationConfigEmbeddedWebApplicationContext : Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6e5e91e4: startup date [Thu Nov 16 14:06:09 UTC 2017]; root of context hierarchy
2017-11-16 14:06:56.342  INFO 21565 --- [       Thread-4] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2017-11-16 14:06:56.348  INFO 21565 --- [       Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-11-16 14:06:56.351  INFO 21565 --- [       Thread-4] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000227: Running hbm2ddl schema export
2017-11-16 14:06:56.363  INFO 21565 --- [       Thread-4] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000230: Schema export complete

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer