How to safely communicate with a database using a java applet

I wrote web applications quite often in PHP with MySQL. I always saved the database connection information to the configuration variable and thus connected to the database.

The client wants the Java applet for their website to communicate with their database. I highly doubt it, because the applet will be public, and I'm not sure how I will store information about connecting to the database.

I'm paranoid for someone to decompile my application or find a way to extract database connection information and use it maliciously.

Any suggestions on how to do this safely?

+3
source share
3

, , , "", , - , ?

, , , , -, JSON/XML. , , , -.

, , , , , . , .

, - . . , , , .

. , - , , .

, -, , , , .

+5

, . .

+1

, JDBC JDBC, .

JDBC Ajax, SQL- JS Servlet, , , - 300 Java- 60 JS.

, HTTP. , , , :

select * FROM records

:

SELECT id, data, val, ... FROM records WHERE userid = ...

That selects only records created by an authenticated user. The only way to ensure security is to access the database only using predefined methods for retrieving / modifying data. Otherwise, data security and isolation must be performed by the database itself. Read the "dear big O database" :)

My 400-line JS / Java example above is used in a test system for home use only.

+1
source

Source: https://habr.com/ru/post/1738625/


All Articles