I'm a newbie to Java-related web development, and I can't seem to get a simple program with JDBC working. I'm using off-the-shelf Oracle 10g XE and the Eclipse EE IDE. From the books and web pages I've checked so far, I've narrowed the problem down to either an incorrectly written database URL or a missing JAR file. I'm getting the fo...
I want to determine if a column exists in a table for any jdbc driver.
In order to know the columns in a table, I have to make a query to the table and then get the ResultSetMetaData for the info, but this is pretty expensive in like 99% of times.
In mysql I have:
SELECT * FROM tablename LIMIT 0,0
In Intersystems caché I have:
SELEC...
Hi all
Currently working in the deployment of an OFBiz based ERP, we've come to the following problem: some of the code of the framework calls the resultSet.last() to know the total rows of the resultset. Using the Oracle JDBC Driver v11 and v10, it tries to cache all of the rows in the client memory, crashing the JVM because it doesn't...
I want to perform JDBC SQL queries on a MDE Access file.
I've set up the data source ODBC and everything worked well for a MDE file.
Now, I'm working with a newer version of the MDE file, and here is the result:
java.sql.SQLException: [Microsoft][Driver ODBC Microsoft Access] Cannont read record. Read authorization unavailable for "tbl...
Hi guys,
I have a problem with a really slow connection between my Java code and a MySQL Database. I don't know where the bottle neck is.
My program is more or less a chatbot. The user types something in, my program splits the sentence into words and sends it word per word to the database. If it finds something there, the user gets an ...
I'm seeing OraclePreparedStatement executeQuery() exhibit serialization. That is, I have two queries that I want to run concurrently against an Oracle database, using the same connection. However, the OraclePreparedStatement seems to explicitly prohibit concurrent queries.
My question is: Is this serialization a necessary artifact of...
Specifically, when I return a connection to the pool, does dbcp (and other connection pools) close the statements and resultsets for me?
Or should I be closing these myself?
...
Is there some hack to create a wrapper for java.sql.Connection which works with JDBC 3 and 4 (Sun added a couple of methods and new types to the interface for JDBC 4) without resorting to something which patches the source at compile time?
My use case is that I need to generate a library which works with Java 5 and 6 and I'd really like...
Hi all,
I know that this is a very helping community.. so i hope I will get an answer for my problemt. Actually, I have a swing app which contacts an oracle database via JDBC.
Now I want to deploy this via WebStart. I have a text area in the application that prints out the log messages .
all goes well, jnlp downloads my application ...
It seems that every time I want to perform a db query, I have to write the following:
Connection conn = null;
Statement stmt = null;
ResultSet rset = null;
try {
conn = dataSource.getConnection();
stmt = conn.prepareStatement(sql);
// ...set stmt params
rset = stmt.executeQuery();
while(rset.next()) {
// Do ...
I've got an application that parses log files and inserts a huge amount of data into database. It's written in Java and talks to a MySQL database over JDBC. I've experimented with different ways to insert the data to find the fastest for my particular use case. The one that currently seems to be the best performer is to issue an extende...
My question is very related to this one: http://stackoverflow.com/questions/932625/multiple-dynamic-data-sources-for-a-servlet-context. However I haven’t found a proper solution just yet and would like to ask it again.
I have a little JSF application that talks to a MS SQL Server via JDBC. Tomcat is used as the web container. The applic...
Hi,
I want to add the oracle jdbc driver to my project as dependency (runtime scope) - ojdbc14.
In MVNrepository site the dependency to put in the POM is:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.3.0</version>
</dependency>
of course this does't work as it is not in the c...
Is there a jdbc driver for SQL Server that can search for database instances on network?
Just wanting to emulate "OSQL -L" from the JDBC driver. Dont want to have to call OSQL from JNI or something. I also don't want to have to write my own code for scanning a UDP port.
I want my Java application to be able to search for live SQL S...
In Java, of course. I need to enable "force", but I have no idea how. I'm sure it might go somewhere in the URL, but I've tried a bunch of different things and looked for a bit on Google, to no avail.
Thanks!
...
I have some files stored in a database blob column in Oracle 9.
I would like to have those files stored in the file system.
This should be pretty easy, but I don't find the right snipped.
How can I do this in java?
PreparedStatement ptmst = ...
ResutlSet rs = pstmt.executeQuer();
rs.getBlob();
// mistery
FileOutputStream out...
I am looking for something similar to the Ant sql task but that will accept a JDBC url of the format:
jdbc:oracle:thin:@TNS_NAME
One possible approach seems to be to write my own Ant task that uses an OracleDataSource to create the Connection, but is there a way to do this straight in Ant?
EDIT:
Thanks for the responses so far g...
I am using the thin Oracle JDBC driver ver 10.2.0 (ojdbc14.jar). I would like to configure its NLS_LANG setting manually. Is there a way?
Currently it fetches this setting from the VM variable user.language (which is set automatically by setting the current locale, or on startup from the system environment).
This is a problem when the ...
I'm trying to create a java program to cleanup and merge rows in my table. The table is large, about 500k rows and my current solution is running very slowly. The first thing I want to do is simply get an in-memory array of objects representing all the rows of my table. Here is what I'm doing:
pick an increment of say 1000 rows at a ti...
I've been struggling to get a Java program to connect to MS SQL Server, and I'm starting to wonder if MySQL would be a better choice for my (learning) project.
Sun's tutorials refer to Java DB, but I've never heard of that in any other context, so it seems not the most useful database to learn about.
I appreciate any insight into the m...