Reputation: 8135
Does Java use a TCP
connection for JPA
requests to database? For example, if the database server has its IP address
set to x.x.x.x:xxxx
, what kind of proxy can handle that connection ? HTTP
or TCP
proxy ?
Upvotes: 1
Views: 708
Reputation: 20190
people are confused on this question because JPA != nosql and in fact are quite incompatible. There are some things the same but JPA is really made for an RDBMS.
All the java clients under the ORM's all use hector, astyanax, etc. etc. which all use thrift which is tcp based. So you can proxy the tcp if you like and you can generate your own thrift library like astyanax and hector do and create any type of proxy you need.
Dean
PlayOrm Developer
Upvotes: 1
Reputation: 68962
A JDBC driver does not necessarily use a network connection. Hypersonic (HSQL) for example provides different modes of operation
If it is configured as a server it will accept TCP connections and can be accessed with an JDBC-URL like:
jdbc:hsqldb:hsql://machine/dbname
In embedded mode there is no TCP connection required the URL wouldn't have a server name (or IP) an URL would look like:
jdbc:hsqldb:mem:dbname
If you use a database server you need to configure the JDBC URL with the machines name (port number if you don't use the default value). There is no need for a proxy, the driver will establish the connection by itself. Btw. HTTP has nothing todo with JDBC.
Upvotes: 3
Reputation:
See the Oracale pages on JPA and the Java EE 6 Tutorial.
How you connect to your database depends on the database and the JDBC driver you use. Some databases like SQLite don't use any network connection.
Upvotes: 1