Hi, I want to create on ObjectOutputStream, but I don't want to persist the object in a file, so how to do that? All the tutorials(that I found) say only about the file way:
FileOutputStream fos = new FileOutputStream("t.tmp");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(new Date());
...
Hello,
I am making a web-app with Tomcat 6 as the container and I'm trying to use connection pooling. The jdbc driver I am using is jtds-1.2.2.
The pool works fine when the driver jar is placed under ${Catalina_Home}/lib, but my hosting provider would not let me do so.
I get a CNF-Exception when the driver is placed in the WEB-INF/lib....
Hi,
I've switched my webserver from tomcat to jetty and encounter a "java.sql.SQLException: Io exception: Connection reset" when back from idle time (eg. i go out for a while) :(
This issue doesn't appear when i use tomcat. Does it come from jetty or i've done something wrong ?
Here is my datasource config
<bean id="dataSourceOracle"...
I have a very strange issue with some of my servlets. Below is my configuration:
Folder A has X number of servlets deployed in Tomcat directory
Folder B has Y number of servlets deployed in Tomcat directory
After certain amount of time or hits to any of the servlets in Folder B, it stops working properly, whereas at same time all se...
hello everybody i have an issue cause i have a java an application which needs to be audited so obviously i need a way in which the app can be identified with the application name so i googled and found that the ojdbc14 has the method .setClientInfo which allows to register the application with a customized name so i am trying to get it ...
After reading previous questions about this error, it seems like all of them conclude that you need to enable XA on all of the data sources. But:
What if I don't want a distributed
transaction? What would I do if I want to
start transactions on two different
databases at the same time, but
commit the transaction on one database
and ro...
How would you convert a java.util.List<String> instance into a java.sql.Array?
...
I have a simple query using JDBC of an Oracle database which is proving slow to retrieve, even though the query itself doesn't seem to be the problem. A profiler reveals that a lot of time is spent in:
ResultSet#getString(String)
methods, some of which are retrieving Oracle NUMBER columns which are of Java long precision, or thereabou...
i am trying to set to jpa the new JDBC method which allows the application to be identified with a name it is the setClientInfo() and i could do it using pure JDBC using the lines
Properties jdbcProperties = new Properties();
jdbcProperties.put("user", "system");
jdbcProperties.put("password", "sw01");
jdbcProperties.put("v$session.prog...
I’m not sure how to use Java/JDBC to insert a very long string into an Oracle database.
I have a String which is greater than 4000 characters, lets say it’s 6000. I want to take this string and store it in an Oracle database.
The way to do this seems to be with the CLOB datatype. Okay, so I declared the column as description CLOB.
N...
I'm just getting my head around java (and OOP for that matter), the only thing I am familiar with is MySQL. I need to keep the DB connection open throughout the duration of the application, as well as a server socket.
I'm not even sure if they both need separate classes, but here's what I have so far:
http://pastebin.com/qzMFFTrY
(it w...
I have the following type declaration and Oracle function:
CREATE OR REPLACE TYPE var_outcomes_results IS TABLE OF VARCHAR2(80);
CREATE OR REPLACE FUNCTION getValuesAbove(in_nodeID IN table1.KEY_SL%TYPE,
in_variable IN VARCHAR2)
RETURN var_outcomes_results
IS
currentID table1.KEY_SL%TYP...
hello everybody i am using JPA with EclipseLink and oracle as DB and i need to set the property v$session of jdbc4 it allows to set an identification name to the application for auditing purposes but i had no lucky setting it up....i have been trying through entitiyManager following the example in this page: http://wiki.eclipse.org/Conf...
I'm looking for the way to populate a JSP dropdown. I want that when the JSP loads it fills the dropdown with the info that I have in a database table.
I'm including the code of my class that will create the array and fill it with the database info. What I don't know is how to call that class from my JSP and fill the dropdown.
// this ...
In the JDBC code, I have the following that is working with SQL Server:
CallableStatement stmt = connection.prepareCall("{ call getName() }");
ResultSet rs = stmt.executeQuery();
if(rs != null)
{
while(rs.next())
{
//do something with rs.getString("name")
}
}
Multiple rows are returned for the above situation.
I under...
I'm evaluating the Oracle Universal Connection Pool (UCP) included with their 11.2 JDBC driver, but cannot get the labeling functionality to work properly (which I'd like to use to minimize the amount of ALTER SESSION statements).
I'm basically following their sample code to implement the ConnectionLabelingCallback interface. The callba...
I have downloaded MySQL JDBC driver from http://www.mysql.com/downloads/connector/j/. How do I configure it?
...
I want to create a text field in the database, with no specific size (it will store text of length unknown in some case) - the particular text are serialized simple object (~ JSON)
What is the most database independent way to do this :
- a varchar with no size specified (don't think all db support this)
- a 'text' field, this seems to b...
I juste installed mysql on my ubuntu box (lycid lynx) and try to connect to mysql trough java.
Mysql is configured to allow only local connection. I can connect to mysql server with the mysql client locally and also i can with PHP. But from java no!
I get this error "Host '....' is not allowed to connect to Mysql server". The address ip...
How to use optimistic locking with batch updates? I am using SimpleJdbcTemplate and for single row I can build update sql that increments version column value and includes version in WHERE clause.
Unfortunately te result int[] updated = simpleJdbcTemplate.batchUpdate does not contain rowcounts when using oracle driver. All elements are...