alvin's blog

Java JDBC - a SQL SELECT query example

Java SELECT query FAQ: Can you share an example of a SQL SELECT query using the standard JDBC syntax?

In our JDBC connection article we demonstrated how to connect your Java applications to standard SQL databases like MySQL, SQL Server, Oracle, SQLite, and others using JDBC.  In our examples we showed how to connect to two different databases just so you could see how little the code changes when you switch from one database to another.

JDBC 101 - Connect to a SQL database with JDBC

Java database FAQ: How do I connect to a SQL database with Java and JDBC?

If you're interested in connecting your Java applications to standard SQL databases like Oracle, MySQL, SQL Server, and others, the Java JDBC technology is exactly what you need. The combination of Java/JDBC and standard SQL queries creates a simple and powerful database solution. JDBC makes the simple things easy -- without making the complex tasks too difficult either.

Java ternary examples - the Java ternary operator

Summary: Examples of the Java ternary operator syntax.

Interested in saying a lot while writing a little? In a single line of code, the Java ternary operator let's you assign a value to a variable based on a boolean expression (either a boolean field, or a statement that evaluates to a boolean result).

At its most basic, the ternary operator (also known as the conditional operator) can be used as an alternative to the Java if/then/else syntax, but it goes beyond that, and can even be used on the right hand side of Java statements.

Syndicate content