You can access the database the way you want, but this is not currently recommended, as it is much more complex, impairs performance and leaves your database vulnerable.
It is not because your application does not run on the internet that you cannot use a webservice to take responsibility for SQL queries.
If you still want to do this, simply import the Mysql connection library into Java in your project and perform the same functions of the database.
Example of connection:
public void conectarMySQL(String host, String porta, String banco, String usuario, String senha){
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch(Exception erro){
Log.e("MYSQL","Erro: "+erro);
}
try{
conn=DriverManager.getConnection("jdbc:mysql://"+host+":"+porta+"/"+banco+"?connectTimeout=9000&socketTimeout=9000&autoReconnect=true&secondsBeforeRetryMaster=3",usuario,senha);
Log.i("MYSQL", "Conectado.");
} catch(Exception erro){
Log.e("MYSQL","Erro: "+erro);
}
}
To use the webservice you can do yours yourself, creating the queries you want. I use today, in an internal network only application (which seems to be your case) PHP + JSON, which greatly facilitated my work on the Android interface.
If you want more references on the subject, there is a suggestion link: https://www.androidpro.com.br/blog/armazenamento-de-dados/usando-banco-de-dados-externo-no-android/
and what your brother doubt?
– Michel Simões
I made an answer to your question, but here you should put the problem you are having when making your code and not ask for a code ready.
– Leticia Rosa