Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Specifying TCP protocol in JDBC to mysql connection

0

49 views

How do you specify that the JDBC connection to mysql in the typical line

DriverManager.getConnection(url, username, password);

is via TCP?

Thanks

asked June 15, 2011 8:50 pm CDT
posted via StackOverflow

3 Answers

0
 

Just use a JDBC type 3 or 4 driver.

Even more, as far as I know, all MySQL JDBC drivers are type 3/4 already.

answered June 15, 2011 9:27 pm CDT
0
 

As far as I know, TCP will be the underlying protocol despite the nature of the driver used. Unlike Derby or HSQLDB, MySQL does not support (at the time of writing this) any form of databases that operate in an embedded mode.

All connections made to the database for the purpose of executing SQL statements, made by the driver happen to be TCP connections.

answered June 15, 2011 9:27 pm CDT
-1
 

is this what you are looking for?

DriverManager.getConnection("jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8", username, password);

answered June 15, 2011 9:27 pm CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
JDBC SQL Connection
March 1, 2011
Text search in mysql jdbc
February 23, 2011