0

I created system dsn using mysql driver now i have connection path. how to use it in java code.to get connection.

1 Answer 1

3

Don't use ODBC. Use MySql JDBC Connector. Take a look at Tutorial.

Tutorial link:

  1. MySQL and Java JDBC - Tutorial
  2. Writing JDBC Applications with MySQL
  3. Using JDBC with MySQL, Getting Started
Sign up to request clarification or add additional context in comments.

3 Comments

Give some examples for connection.
In c# it is easy.but in java i don't know how to use
DriverManager.getConnection("jdbc:odbc:TOY2","root","root");can i give different dsn path here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.