JDBC Section Index | Page 6
The first thing is to be sure that this does not occur when running non-JDBC apps. If so, there is a faulty JDK/JRE installation. If it happens only when using JDBC, then it's time to check the ...more
DB2 Universal defaults to the 1.0 driver. You have to run a special program to enable the 2.0 driver and JDK support. For detailed information, see Setting the Environment in Building Java Apple...more
One tool to use is Mimer SQL Validator. This page links to validators for SQL-92 and SQL-99 ( SQL3 ). In addition, there is a list of SQL reserved words.more
My driver claims to support JDBC 2.0, but some methods get an unsupported exception. How can I verify that the driver will work?
The DatabaseMetaData class has a large number of supportsXXX methods which you can use to ensure that the operation will proceed or otherwise provide a workaround. See the API documentation for d...more
How can I overwrite blob data in an Oracle database? I want to replace the blob in the selected row with byte blobData using the following code: OracleResultSet rset=null; OutputStream os=null;...more
I've heard that I can save space by allowing NULLs for columns where no value is supplied. Is that correct?
While the answer is ultimately dependent on your specific DBMS, most databases create an extra byte for every null capable column to mark whether or not it contains a null value. This clearly mea...more
Null capability is a column integrity constraint, normally aplied at table creation time. Note that some databases won't allow the constraint to be applied after table creation. Most databases a...more
How to get a field's value with ResultSet.getxxx when it is a NULL? I have tried to execute a typical SQL statement: select * from T-name where (clause); But an error gets thrown because there ar...more
Use either of the following PreparedStatement methods: public void setNull(int parameterIndex, int sqlType) throws SQLException public void setNull(int paramIndex, ...more
Is there a way to find the primary key(s) for an Access Database table? Sun's JDBC-ODBC driver does not implement the getPrimaryKeys() method for the DatabaseMetaData Objects.
// Use meta.getIndexInfo() will get you the PK index. Once // you know the index, retrieve its column name DatabaseMetaData meta = con.getMetaData(); String key_colname = null; // get the pri...more
Here some possible solutions for your problem: It's Excel-lent and The Java-Excel solution revisited. Joe Sam Shirah adds: Also see How can I connect to an Excel spreadsheet file using jdbc? an...more
TOMCAT 4.0.1 on NT4 throws the foll exception when i try to connect to Oracle DB from JSP. javax.servlet.ServletException : oracle.jdbc.driver.OracleDriver Root Cause : java.lang.ClassNotFoundEx...more
The following documentation from Oracle should help: Working with BLOBs and CLOBs Also see Clob Updating.more
I try to execute this procedure through CallableStatement, then I execute by calling the execute() method. When I process this using getMoreResults() & I am getting only update count, not my output parameter.
I have a Stored procedure, which consists of the following: Creating a Temp Table Inserting Records to that Do some more modifications.. Creating Cursors Some Select Statements... Mo...more
I'm using the Oracle thin driver to update a batch of records using a prepared statement, addBatch() and executeBatch(). All of the updates go through fine and the data is updated correctly, but all of the updateCounts returned are "-2". I haven't been able to find any documentation for the thin driver, so I don't know if this return code is something I should be worried about, or if I should just ignore it.
From the JDK 1.3 Statement.executeBatch() API documentation: "A value of -2 -- indicates that the command was processed successfully but that the number of rows affected is unknown." See the docu...more