Troubleshooting

Setting Up the Correct JDBC URL

The attempt at creating a database connection using a JDBC driver fails.

Because each JDBC driver vendor has flexibility to use a slightly different JDBC URL, you can never really guess at the format of the URL. As mentioned earlier in this chapter, the URL has the following format:

jdbc:<subprotocol>:<subname>

Remember that a colon must separate each section. The protocol for a JDBC URL is always jdbc. The subprotocol and the subname is the part that will vary across vendors. It usually depends also on the driver type that the driver implements as well. The best advice is to read the documentation thoroughly when setting up the database URL. There really is no standard way except to read the ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.