ODBC and JDBC Performance

I have an assignment to use Java and C with a MySQL database and compare the results and explain the reasons for this result.

No. of Records Execution time (ms)
Records Java C
100 586 76
500 628 216
2000 733 697
5000 963 1056
10000 1469 2178

As you can see, with fewer records retrieved from the database, C (ODBC) works better. But as the number of entries increased, Java (JDBC) came out as the winner.

The reason I thought it was because ODBC drivers load much faster than JDBC, but JDBC access speed is better than ODBC, hence the results. However, I cannot find such reasoning anywhere.

Any suggestions please?

+8
source share
4 answers

Statements submitted to the Web site mathworks , appear to be common.

Choosing between ODBC and JDBC Drivers

Use your own ODBC to:

  • Highest performance for importing and exporting data
  • Import and export data with a large amount of memory

Use JDBC to:

  • Platform independence that allows you to work with any operating system (including Mac and Linux®), driver version or bit capacity (32-bit or 64-bit)
  • Using Database Toolbox features not supported by the native ODBC interface (e.g. runstoredprocedure)
  • (, LONG, BLOB, ..)

:

  • Windows, ODBC JDBC, JDBC ODBC , JDBC/ODBC.
+9

:

: - JDBC - ODBC ( , )

: - ODBC - Windows - JDBC Java , Java

Power: JDBC, ODBC, .

: - ODBC . JDBC - ( java).

: - JDBC - ODBC

ODBC: API , .     ( , Oracles)

API: JDBC API - Java- ODBC, JDBC ODBC

+3

, , ?

, ODBC C. ODBC , JDBC, JDBC-ODBC ( Jython ). , . , JVM JIT - , .

, . ODBC, JDBC. ODBC .

+2

ODBC JDBC , JPA Hibernate.

C++, ODBC, C, , . , Java-, , , .

, - , , , , API. , , , , , , , ODBC JDBC.

Use the driver recommended by the supplier, taking into account the language in which you are developing. And leave the performance issues to the solution for database administrators and SQL developers. This is not the place where you are going to eliminate bottlenecks in your database.

0
source

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


All Articles