Home » Author Archives: Dustin Marx

Author Archives: Dustin Marx

Setting PostgreSQL psql Variable Based Upon Query Result

postgresql-logo

When using PostgreSQL‘s psql command-line tool to interact with a PostgreSQL database via operator interaction or script, it is not uncommon to want to set psql variables based on the results of a particular query. While PostgreSQL’s procedural language PL/pgSQL supports approaches such as SELECT INTO and assignment (:=) to set PL/pgSQL variables based on a query result, these approaches ...

Read More »

Procedure-Like Functions in PostgreSQL PL/pgSQL

postgresql-logo

PostgreSQL does not support stored procedures in the sense that a database such as Oracle does, but it does support stored functions. In this post, I look at a few tactics that can make the use of a stored function in PostgreSQL (stored function and its calling code both written in PL/pgSQL) feel like using a stored procedure. These simple ...

Read More »

Java Numeric Formatting: DecimalFormat

java-logo

In the post Java Numeric Formatting, I described and demonstrated some of the useful instances provided by NumberFormat static methods such as NumberFormat.getNumberInstance(Locale), NumberFormat.getPercentInstance(Locale), NumberFormat.getCurrencyInstance(Locale), and NumberFormat.getIntegerInstance(Locale). It turns out that all of these instances of abstract NumberFormat are actually instances of DecimalFormat, which extends NumberFormat. The next code listing and the associated output demonstrate that all instances returned by ...

Read More »

Using Hibernate Bean Validator in Java SE

jboss-hibernate-logo

The main Bean Validation page states that “Bean Validation is a Java specification which … runs in Java SE but is integrated in Java EE (6 and 7).” This post demonstrates using Java Bean Validation reference implementation (Hibernate Validator) outside of a Java EE container. The examples in this post are based on Hibernate Validator 5.1.3 Final, which can be ...

Read More »

Windows Registry Cleanup after JDK 9 Early Release Installation

java-logo

In my last blog post, I demonstrated resolution of issues surrounding the Oracle Java symbolic links (C:\ProgramData\Oracle\Java\javapath\ directory on Windows-based machines) after I had installed an early release of JDK 9 (build 68) that seemed to prevent automatic installation of earlier (more stable) Java versions from working properly. Even with the symbolic links fixed in the C:\ProgramData\Oracle\Java\javapath\ directory, I still ...

Read More »

Oracle Java on Windows

java-logo

I recently downloaded an early access release of JDK 9 (build 68) for my Windows 7-based laptop. Because this is an early release, I was not surprised when the automatic installation introduced some less than ideal issues with the main Java Runtime Environment (JRE) installation on my laptop. After playing with the JDK 9 features that I wanted to try ...

Read More »

Generating JSON Schema from XSD with JAXB and Jackson

json-logo

In this post, I demonstrate one approach for generating JSON Schema from an XML Schema (XSD). While providing an overview of an approach for creating JSON Schema from XML Schema, this post also demonstrates use of a JAXB implementation (xjc version 2.2.12-b150331.1824 bundled with JDK 9 [build 1.9.0-ea-b68]) and of a JSON/Java binding implementation (Jackson 2.5.4). The steps of this ...

Read More »

Software Development Lessons Learned from Consumer Experience

software-development-2-logo

Because we software developers are also inevitably consumers of others’ software applications, we are undoubtedly influenced in the creation of our own software by the software we use. For example, our opinions of what makes an effective interface for users are influenced by our experiences “on the other side” using someone else’s software interface. This is particularly true for web ...

Read More »

The JDK 8 SummaryStatistics Classes

java-logo

Three of the new classes introduced in JDK 8 are DoubleSummaryStatistics, IntSummaryStatistics, and LongSummaryStatistics of the java.util package. These classes make quick and easy work of calculating total number of elements, minimum value of elements, maximum value of elements, average value of elements, and the sum of elements in a collection of doubles, integers, or longs. Each class’s class-level Javadoc ...

Read More »

Displaying Paths in Ant

apache-ant-logo

In the blog posts Java and Ant Properties Refresher and Ant <echoproperties /> Task, I wrote about how being able to see how properties are seen by an Ant build can be helpful in understanding that build better. It is often the case that it’d also be valuable to see various paths used in the build as the build sees ...

Read More »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.