Combining database with a Java application can be a complicated task. From one side, Java does not support multi-line string constants, so developers can end up with code that looks like this:
String sql_query = "select *" + "from user_table" + "where name like 'John%
This line of code is not "very pretty" but also has errors. Did you notice the missing space between
where? A further challenge when working with SQL in Java is that we often need to build the SQL dynamically.
Java Database Connectivity (JDBC), is a standard Java API for database-independent connectivity between the Java programming language and a wide range of databases. Using JDBC one can send statements to almost any relational database. Thus, JDBC is a Java API for executing the
SQL statements and supports basic
So, what exactly JDBC do? Here's the list:
- Making a connection to the database.
- Creating SQL statements.
- Executing SQL queries in the database.
- Viewing and Modifying the resulting records.
Learn more about JDBC. You will be using Eclipse Kepler SR2, JDK 8, MySQL Database and Maven to create JDBC Query Builder.