Edit database myself


I want to make database request (for my personnal data), but I don’t know how I can access to database connection or method to manage it.
And this is not any documentation about it.
How to do ?

And, I have another question :
How to use “created_on”, “created_by” … values and not create my own column which does the same things ?

Best regards.

using axelor or directly?

Using Axelor configuration and database connection

I do it like that

Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/axelor", "axelor", "axelor");
sqlQuery="INSERT INTO base_logiciel (type_logiciel, version_majeur) VALUES (?,?)";
prepare = connection.prepareStatement(sqlQuery);
prepare.setLong(1, idtypelog);
prepare.setString(2, versionmaj);		

Ok so you don’t use Axelor connection ?

It was to use the same DB configuration, to don’t hardcode username and passwd.

you want to add new model ?

Use DB directly is to edit the data juste before save it, or to do another update when edit an object.

for that there is entity listener available

we are using cdc based on debezium to call external services

1 « J'aime »

Ce sujet a été automatiquement fermé après 30 jours. Aucune réponse n’est permise dorénavant.