jdbc

Hitting some limit under z/OS with DB2 Connect JDBC t4 driver.

We have an application connecting to DB2 under z/OS and, after a while, there seems to be some resource limit being hit on the mainframe side. Since we're using BIRT, it seems the only control we have over the JDBC code is with stanzas in the URL itself. we don't have direct Java control over the connection or statements (except for the ...

Custom oracle exceptions through JDBC

In a stored procedure I have used to; raise_application_error (-20010, 'My Message'); to raise a custom error in a certain situation. What I am trying to do is when I make my JDBC call from java, to be able to identify this error as not just being a SQLException so that I can handle it differently. I though I could identify it by the ...

Weblogic 10.0: advantages with database connectivity and gotchas?

What advantages (if any) does Weblogic 10.0 provide in terms of database connectivity (to any database) over open source or commercial alternatives? Are there any Weblogic specific gotchas with using a Weblogic database connection? I'm a J2/JEE, Weblogic newbie so please excuse the simple questions. ...

Reading Unicode data from an Access database using JDBC

Hello, I have an MS-Access database, which I am connecting to in Java using the JDBC (I think the JDBC-ODBC bridge). My access database has some values which are in hebrew. When I try to read these values using String str = rs.getString(1) (rs is a RowSet), the string I get is just a string of question marks. I have other strings in h...

Java JDBC ignores setFetchSize ?

Hi, I'm using the following code st = connection.createStatement( ResultSet.CONCUR_READ_ONLY, ResultSet.FETCH_FORWARD, ResultSet.TYPE_FORWARD_ONLY ); st.setFetchSize(1000); System.out.println("start query "); rs = st.executeQuery(queryString); System.out.println("done query"); The query return a lot of (800k...

Execute SQL on CSV files via JDBC

Dear all, I need to apply an SQL query to CSV files (comma-separated text files). My SQL is predefined from another tool, and is not eligible to change. It may contain embedded selects and table aliases in the FROM part. For my task I have found two open-source (this is a project requirement) libraries that provide JDBC drivers: CsvJ...

Java ResultSet how to getTimeStamp in UTC

The database has data in UTC and when I try to get data java.util.Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("UTC")); java.sql.Timestamp ts = resultSet.getTimestamp(PUBLISH_TIME); cal.setTime(ts); Is there anything wrong with this? ...

How to make JDBC SQLExceptions for DB2 more descriptive?

How to make SQLExceptions thrown by DB2 JDBC driver more descriptive? Currently I am getting this kind of exceptions. It is cumbersome to work with these cryptic SQLCODE and SQLSTATE numeric values. Is there a way where to make the SQL exception to contain code description. Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLC...

unable to update CLOB using DBCP connection

Am trying to do update a clob column using a connection object that is retrieved using Apache DBCP connection pooling. Earlier, I've implemented connection pooling using this and it was working fine i.e am able to update CLOB. I switched to DBCP because I was getting java.sql.SQLException: ORA-01000: maximum open cursors exceeded. I've ...

Reading a BLOB using JDBC Spring without a result set

I have an Oracle stored procedure that returns a BLOB in an output parameter: PROCEDURE GET_IMAGE_DATA(i_image_type IN NUMBER, o_image_data OUT BLOB) IS BEGIN SELECT IMAGE_DATA INTO o_image_data FROM IMAGES WHERE IMAGE_TYPE = i_image_type; END GET_IMAGE_DATA; I want to use JDBC Spring to read this...

Unable to close JDBC resources!!!

We are running a websphere commerce site with an oracle DB and facing an issue where we are running out of db connections. We are using a JDBCHelper singleton for getting the prepared statements and cosing the connections. public static JDBCHelper getJDBCHelper() { if (theObject == null){ ...

how to set fetch size for jdbc odbc driver

Hi, Im using sun.jdbc.odbc.JdbcOdbcDriver to connect to an oracle database.I know I would be probably be better off using the thin driver but I want the app to work without specifying the db server name and port no.My connection string is like jdbc:odbc:DSN. The queries that I execute in my application may return millons of rows.All th...

EJB 3 with JDBC

Is it possible to use EJB 3 with JDBC. I read somewhere, that it's allowed. However, I hear that EJB 3 implementation uses JTA, by default. What does that mean for JDBC? Is it only for the transaction support? That means JTA is used for transaction when using JDBC code? Meaning that even local transactions are implemented as global tran...

SQL Server / JDBC Connectivity Issues

I am experiencing some strange behaviour in my Java server application whereby database operations that usually take a few milliseconds are sporadically taking much longer (30s - 170s) to complete. This isn't isolated to a specific query as I've seen the delays occurring for both SQL update and select statements. Also, all of my select...

Using Sybase ASE 12.5.4 with jTDS drivers with JRuby

Problem I am trying to build a small ruby script - which will be run using jruby once a day - to connect to a Sybase ASE 12.5.4 database and perform a complex query. Ultimately I intend to do some processing on the data and insert the new data in a MySQL table for use within a rails application. Environment jruby v1.4.0 java v1.6.0...

Spring RDBMS vs JDBCTemplate

How much of a performance difference is there between these two models? What kind of reasons are there for using one over the other? In my application I am using a lot of the same statements over and returning both Objects and primitives. There are a few oracle stored procedure calls and performance on these is a top priority. ...

how to get oracle port no from sql query

Hi, Is it possible to get the oracle server port no from a sql query? Thanks, Fell ...

How to execute .sql script file using JDBC

I have an SQL script file which contains 40-50 SQL statements. Is it possible to run this script file using JDBC? ...

How to SELECT items from from an array (IN clause details)?

I would like to do something in Java (using iBatis, JDBC, etc., really in SQL) like: SELECT SUM(rowName) FROM myTable WHERE id = [myArrayOfIds] Where myArrayOfIds can be almost any length. Now I know you can do: SELECT SUM(rowName) FROM myTable WHERE id IN (x, y, z) but what happens for longer lists? For example my list could be as...

Tomcat 6.0 manager authentication via JDBC realm

I wanted to configure Tomcat6.0 authentication via JDBC realm Configuration.** I checked following: -All my "users" and "roles" are stored in MySQL database. -MySQL JDBC drives are in tomcat\lib directory -Tomcat-user-xml is modified for such realm as below <-Realm className="org.apache.catalina.realm.JDBCRealm" driverName...