driver

A Scala JDBC select and insert example (showing Statement, ResultSet, and PreparedStatement)

Here’s an example of how to connect to a JDBC database with Scala. I have no idea why I got into the try/catch/finally details in a trivial little example like this, but if you want to see how to connect to a database with JDBC and query that database with a JDBC Statement (which yields a ResultSet), I hope this example is a little helpful:

How to connect to a MongoDB database and insert data with Scala

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 16.3, “How to connect to a MongoDB and insert data with Scala.”

Problem

You want to use the MongoDB database with a Scala application, and want to learn how to connect to it, and insert and retrieve data.

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.

Java MySQL examples and tutorials

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 Java DB2 JDBC Driver class and URL example

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:

A Java JDBC SQL Server Driver class and URL example

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

The basic SQL Server JDBC Driver and URL information you need is shown here:

Java MySQL JDBC Driver class and URL example

Java MySQL Driver FAQ: Can you share a Java/MySQL JDBC Driver and URL example, i.e., how to connect to MySQL in Java?

Sure. Here's a quick post to help anyone that needs a quick MySQL JDBC Driver and URL reference.

The basic MySQL JDBC Driver and Java MySQL URL information you need is shown here:

Java JDBC Postgresql Driver class and URL example

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

The basic Postgresql JDBC Driver and URL information you need is shown here:

Java JDBC drivers and driver downloads

In need of a Java JDBC driver for your database? I thought I'd put together a quick list here showing the URLs where you can download the latest JDBC drivers for databases like Postgresql (Postgres), MySQL, and Microsoft SQL Server.

MySQL JDBC driver

MySQL Connector/J is the official MySQL JDBC driver. Here's a link to their JDBC driver: