0

I am a java programmer trying to make the jump to web development and database management. I am trying to figure out the structure of web services in general and I will try to ask some questions that lead to definite non-abstract answers, but I barely understand MySQL so please forgive me if my question has no answer, or is wrong or something.

I understand the concept of a relational database, but I don't understand the how it is implemented in MySQL or SQL in general. Is there a database file somewhere I don't know... Basically my question is how does MySQL store databases and what is the proper way to interact with them?

also is there a way to set up a MySQL database that is not on a server?

  • Normally, implementation details aren't neccessary. You do need to learn SQL to communicate and have a way to connect to a database. –  Jan 25 '15 at 01:08
  • Microsoft Access can be used offline, but I don't know much about java, so I can't help much. –  Jan 25 '15 at 01:09
  • I would like to know about implementation because I think there might be a problem with my current implementation and i would like to understand it, like where the database is stored in my file system – Totalllyrandomguy Jan 25 '15 at 01:12
  • @Isaiah you dont need to know about java, thats just the language I already know, if you know about MySQL and how it stored/the proper way to interact with it then that is all I need. – Totalllyrandomguy Jan 25 '15 at 01:13
  • The easiest way is probably by setting up a server and using php to interact with the mysql database. Thats about the scope of my help for this question, sorry. –  Jan 25 '15 at 01:14
  • 1
    You cannot interact directly with the table files, you need to access them through the server. – Jeremiah Winsley Jan 25 '15 at 01:21

1 Answers1

1

Follow the directions here: http://docs.oracle.com/javase/tutorial/jdbc/basics/gettingstarted.html , for MySQL.

Most RDBMSs, including MySQL, are implemented as servers to which your Java program connects using the JDBC interfaces. There are a few that have local files -- derby, sqlite, access -- but not in general.

Basically, it goes like this:

Java program issues a connect request to a server.

RDBMS Server accepts connect request.

Java program prepares a SQL query, like

 SELECT name, address FROM customer WHERE status = 'active' and zip = ?

Java program binds variables to the query. e.g. variable 1 = string '90210'.

Java program issues query.

RDBMS carries out query, and sends a result set to Java.

Java program receives result set row - by - row and does what it needs to do

O. Jones
  • 103,626
  • 17
  • 118
  • 172