We are using JBoss 4 and Oracle with a JNDI datasource configured via JBoss datasource XML file.
Recently realized that all connections acquired from the datasource by default has the auto-commit property set to true. However, we rely on Oracle stored procedures and want to control the commits within the stored procedures.
We use plain...
Once I deploy my application with JPA the user chooses to install it somewhere. Then however the property set as:
<property name="javax.persistence.jdbc.url" value="jdbc:derby:db;create=true"/>
gets interpreted into the following exception:
couldn't create database in \db.
Throughout development it used to be the relative path to the ...
Hi friends i am facing the following error while trying to connect to a database through java code:
Exception in thread "Main Thread" java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.example.model.Driver.main(Driver.java:13)
My java ...
Hello All,
I am having difficulties while updating a date field into the Database. The field type in the DB is Date/Time.
Now, I am trying to update the field name "R_Date".
Currently, I am using the SQL Expression in my jsp"
UPDATE request SET request_date ='"+Request_Date+"'"; , But it is not accepting.
In the select statement I am...
We currently have a system that displays a page tabular data on the screen without any paging support in the user interface. It is running on Java 1.5 / Spring JDBC / T-SQL stored procs / SQLServer 2000 stack.
In the absence of the ability to skip rows in the result set (limitation of SQLServer 2K without using dynamic SQL); I am explo...
I am writing a java code to connect with MS SQL Server 2005. MS SQL Server is on Remote server windows server 2003. I am trying the following code but i am unable to establish a connection:
import java.*;
public class Connect {
private java.sql.Connection con = null;
private final String url = "jdbc:sqlserver://";
privat...
I have been trying to use spring 3.0 SimpleJdbcTemplate and it takes 5 mins to insert 1500 records, whereas it take me a few secs. to insert using straight JDBC. Not sure what I am doing wrong.
...
hi
I am getting this error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:1585)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1409)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2886)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.jav...
I wish to setup a database table that will be used as a message queue. The table will have messages inserted into it with a unique id and a timestamp and a status of 'PENDING'.
Assuming that the insertion into this table is properly handled, I wish to know what is the best way to transactionally process messages from this table using a ...
I'm trying to find the optimal batch size for some operations we perform in bulk (persisting collections). If insert is going to block a thread, I think I'm going to want to make the batch size ~ the average size of the collection we are going to persist.
If that isn't the case, it might make more sense to find a smaller batch size to ...
I'm working on an application which uses the Spring framework in combination with Ibatis and a C3P0 Connection pool. The system connects to about 12 seperate databases.
When one of the databases is unreachable, I get a stacktrace in the logfile which is generated by Spring (see below). However, this logging is missing very vital informa...
I've been trying to figure out why the following code is not generating any data in my ResultSet:
String sql = "SELECT STUDENT FROM SCHOOL WHERE SCHOOL = ? ";
PreparedStatement prepStmt = conn.prepareStatement(sql);
prepStmt.setString(1, "Waterloo");
ResultSet rs = prepStmt.executeQuery();
On the other hand, the following runs properl...
Hi All,
I use triggers to set PK column values of all tables so i do not do any operation about IDs in java but i need the ID after insert.
How can i get the ID?
stat.execute("INSERT INTO TPROJECT_PROCESS_GROUP(NPROJECT_ID,VDESCRIPTION) " +
"VALUES(" +
"'" + projectID + "'," +
"'" + d...
I am using SQLite in a project used by an android application. Currently I am using the SQLite implementation provided in android.database.sqlite.
I want to make a desktop application which uses the same codebase. So I need to separate all the shared behaviour into a separate portable project/jar.
My problem is I'm currently making hea...
I need to make a connection to an Access Database. In order to do that I created a System DSN. I had success making that connection using local files.
However, the database must be at a remote server and I mapped a network drive so I can access the database files. Mapping the drive and using the remote files, an error arises when I try ...
My project requires me to write a web application with JSP to communicate with Oracle 10g R2
The JSP/Javascript/HTML is held in OC4J 9i and the database is created with characterset as UTF-8. The interface between JSP and Oracle is based on JDBC Thin driver
I tried to type in some Chinese characters on JSP page, then save to Oracle. In...
Hi,
I have got a requirement that mysql database can only be accessed from localhost. I have to implement a servlet that would access the database allowing other servers in this system to access data (servlet would work as a proxy). However, this system consists of a remote server which downloads large portions of data executing a state...
I have been developing a web application for almost a year which I had started in college. After finishing, I made some changes to the database code that I had written during college. I used simple JDBC when I was in college, without the use of connection pooling and prepared statements. In the past month, I have realized the potential, ...
I'm trying to run JUnit tests on database "worker" classes that do a jndi lookup on an InitialContext to get a DataSource. The worker classes are usually running on a Glassfish v3 App Server which has the appropriate jdbc resources defined.
The code runs just fine when deployed on the App Server but doesn't run from the JUnit testing en...
I am using JDBC to query a MySQL database for specific records from two tables.
My MySQL query sample is this:
SELECT
r.name
, r.network
, r.namestring
, i.name
, r.rid
, i.id
, d.dtime
, d.ifInOctets
FROM router AS r
INNER JOIN interface AS i
ON r.rid = i.rid
INNER JOIN 1278993600_1_60 AS d
ON i.id = d.id
AND dtime BETWE...