connection

When people feel disconnected, their worst impulses often come out alvin July 9, 2017 - 5:19pm

“When people feel connected to others, that brings out their best selves. When people feel disconnected, their worst impulses often come out.”

From an interview with a Zen priest, who also happens to be the director of analytics for Facebook’s News Feed.

A simple Java JDBC example that shows SQL insert, update, delete, and select alvin August 10, 2016 - 10:53am

Here’s a short Java/JDBC example program where I show how to perform SQL SELECT, INSERT, UPDATE, and DELETE statements with JDBC:

MySQL show status: How to show open database connections

MySQL "show status" FAQ: Can you demonstrate how to use the MySQL show status command to show MySQL variables and status information, such as the number of open MySQL connections?

I don't have a whole lot of time today to give this a detailed discussion, but here is a quick look at some MySQL work that I did recently to show MySQL open database connections.

Managing MongoDB connections with the Scala Casbah database driver

UPDATE: November 14, 2012. This article describes problems I had when attempting to use the Scala Casbah driver for the MongoDB database. In the end, it turned out I was doing something wrong. However, because this article shows how to troubleshoot MongoDB and Casbah database connection problems, it seems like a good idea to leave it here. If you want to see the correct way to use Casbah with MongoDB, I created this Github project, which shows the correct approach.

A Scala JDBC connection and SQL SELECT example alvin November 8, 2011 - 12:29pm

Scala JDBC FAQ: How can I use the Java JDBC API in my Scala application?

If you want to use a SQL database with your Scala applications, it's good to know you can still use the traditional Java JDBC programming library to access databases. I just ran a simple JDBC connection and SQL SELECT test, and everything seems to work just as it does in Java.

Java MySQL examples and tutorials alvin May 3, 2011 - 12:58pm

Today was mostly a day off for me, but I thought I'd do one thing here to help organize the website a little better. To that end, I've put together a list of the Java MySQL examples I've created, i.e., Java database examples that were specifically written for MySQL.

A Spring MySQL BasicDataSource connection example alvin July 1, 2010 - 12:42am

Spring MySQL FAQ: Can you share a Java Spring MySQL example, showing how to create a Spring Framework application context file so a Java standalone application can connect to a MySQL database?

Sure, here's a Java/Spring MySQL example, specifically showing a Spring application context file that sets up a BasicDataSource (connection) to let your Java application connect to a MySQL database.

A Java DB2 JDBC Driver class and URL example alvin October 7, 2009 - 2:55pm

Here's a quick post to help anyone that needs a quick Driver and URL reference when using DB2 with Java and JDBC.

If all you need is a reference to the DB2 JDBC Driver and URL connection string syntax, this basic information should work:

Java HttpURLConnection (how to open and read a url with Java) alvin October 7, 2009 - 11:05am

On this blog I've shown a variety of ways using Java to open a URL connection, and then read data from that connection, including my "How to open and read from a URL with the Java URL and URLConnection classes" tutorial. In this example I'll show how to open a URL using the Java HttpURLConnection class.

Tomcat connection pool - a Tomcat JNDI DBCP connection pool example alvin September 26, 2009 - 7:50pm

Here's a quick demonstration of how to create a Tomcat connection pool (database connection pool) using the Tomcat DBCP library.

I'm not going to go into a detailed explanation here of how Tomcat DBCP works, other than to say that it works for me, and I've tried to include everything here that you'll need to implement your own Tomcat DBCP database connection pool in your web applications.