Is JDBC safe?

I am new to JDBC and the new project requires me to use JDBC. I want to know,

is jdbc safe?

How to prevent the problem with the "Mysql Injection" problem?

What security issues should I look for when using JDBC?

And how do I ensure, I mean security optimization, to prevent hackers from hacking the database?

EDIT:

I tried google if i google:

"Php mysql security problems" => gives a lot of results

if i google:

"Jdbc mysql security problems" => hard to see related pages

Does this mean that using jdbc is safe? No need to worry about being hacked?

+3
6

. , :

PreparedStatement stmt = conn.prepareStatement("SELECT * FROM member WHERE member_username = ? AND member_password = ?");
stmt.setString(1, username);
stmt.setString(2, password);
stmt.execute();

ResultSet rs = stmt.getResultSet();
// ...

SQL Injection.

+12

JDBC?

JDBC - JDBC. , SSL, , SSL-. , .

"Mysql Injection"?

SQL- JDBC, , "" , SQL. :

String query = "SELECT * FROM SOME_TABLE WHERE X = '" + someString + "' ;";

someString unescaped '' ', , SQL, . , someString, - '' '( ), , escape- SQL.

( / ) ?? setString(...) ..

JDBC?

, JDBC. JDBC.

, , ?

  • / .
  • .
  • /.
+10

JDBC - , , .

JDBC. , SQL . , , .

+5

JDBC - .

, , - .

JDBC SQL . SQL-, , , odbc jdbc.

SQL- - ?? . SQL- ( , , ).

+2

, , - DB acceess api.

0

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


All Articles