SQLException: No suitable driver found for jdbc:derby://localhost:1527

java.sql.SQLException: No suitable driver found for jdbc:derby://localhost:1527/ This exception has two causes: The driver is not loaded. The JDBC URL is malformed. In your case, I’d expect to see a database name at the end of the connection string. For example (use create=true if you want the database to be created if it doesn’t exist): … Read more

Glassfish Admin Console throws java.lang.IllegalStateException when creating JDBC Pool

According to the following JIRA tickets: Cannot Create JDBC Resource or Connection Pool in Admin Console Cannot create JDBC Connection Pool this is still an unresolved issue. Even though we can expect such things since Oracle abandoned a commercial support for Glassfish, it is still horrible that such basic functionality does not work. However, if … Read more

Overcomplicated oracle jdbc BLOB handling

The update approach you mention in the first case can be rewritten using pure JDBC code and thus reduce your dependency on Oracle-specific classes. This could be helpful if your app needs to be database agnostic. public static void updateBlobColumn(Connection con, String table, String blobColumn, byte[] inputBytes, String idColumn, Long id) throws SQLException { PreparedStatement … Read more

How to get a java.time object from a java.sql.Timestamp without a JDBC 4.2 driver?

New Methods On Old Classes By using the driver with Java 8 and later, you should automatically pick up some methods on your java.sql.Timestamp object for free. Both java.sql.Time and java.sql.Date have similar conversion methods. Namely, to convert from java.sql to java.time you are looking for: Timestamp::toInstant() Timestamp::toLocalDateTime() Date::toLocalDate() Time::toLocalTime() To go the other direction, … Read more

ORA-12516, TNS:listener could not find available handler

You opened a lot of connections and that’s the issue. I think in your code, you did not close the opened connection. A database bounce could temporarily solve, but will re-appear when you do consecutive execution. Also, it should be verified the number of concurrent connections to the database. If maximum DB processes parameter has … Read more

PostgreSQL/JDBC and TIMESTAMP vs. TIMESTAMPTZ

Generally use TIMESTAMPTZ Here’s advice from David E. Wheeler, a Postgres expert, in a blog post whose title says it all:Always Use TIMESTAMP WITH TIME ZONE (TIMESTAMPTZ) If you are tracking actual moments, specific points on the timeline, use TIMESTAMP WITH TIME ZONE. One Exception: Partitioning Wheeler’s sole exception is when partitioning on timestamps, because … Read more

How do I get the row count in JDBC?

You’re going to have to do this as a separate query, for example: SELECT COUNT(1) FROM table_name Some JDBC drivers might tell you but this is optional behaviour and, more to the point, the driver may not know yet. This can be due to how the query is optimised eg two example execution strategies in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)