How can I connect to a MySQL DB and execute queries?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
…if you really are going to use java to query a MySql server you should look further and read some about JDBC, ORM, transactions and how this concepts will help you using a database.
You can use JDBC to query an Mysql database, and virtually any other DBMS who have an JDBC driver implemented.
An ORM system provides the programmer with a layer between Objects and Database and makes all the hard work for you (in theory).
Even with the previous point you really need to have some basic knowledge about transactions, that encapsulates your actions in one atomic unit that only executes completely or does not execute at all.