Skip to content

How to read database view metadata

I’m trying to use Java and Spring to read the table structure for a MySQL database. The code I’ve got (based on other answers on this site) is: If I call this code with the name of any of my database tables, it works perfectly. However, when I pass the name of any of my database views, I get the

Optional parameters: Multiple constructors cause errors

Since in Java optional parameters are not possible, I tried to create 2 constructors. Now my problems are the private properties. There I get the error Variable ‘_mediaPlayer’ might not have been initialized In another method, I want to check if the properties are set. But how can I avoid these er…