I am inserting a record to orcle db through java application. The date value inserted as 02/10/0010 instead of 02/10/2010 HH:MM:SS AM/PM? I am using oracle jdbc connection. Does it problem with JDBC driver ?
Any input on this.
...
I have a problem accessing a database through a JDBC connection.
End of stream was detected on a read
The error occurs at several different points at random.
I appreciate any help.
...
I have used many SQL abstraction libraries, such as ODBC, JDBC, and ActiveRecord. What are the abstraction options in the NoSQL / key-value store world?
I am mostly asking this so that if I choose a key-value store then I can use an abstraction library and not be locked in, which I think is important given the number of key value store...
I'm trying to get insert ID while after inserting some data in my database.
String sql = "INSERT INTO ADI.DUMMY(dummy_data) VALUES('from database logger')";
PreparedStatement ps = con.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
int extUptReturn = ps.executeUpdate(sql);
But I got this exception:
Java exception: ''java.lan...
I was trying to do:
String sql = "INSERT INTO CURRENT_WEATHER_US VALUES("+city_code+",
"+object.city+","+object.region+","+object.country+","+object.wind_chill+",
"+object.wind_direction+", "+object.wind_speed+","+object.humidity+","+object.visibility+",
"+object.pressure+","+object.rising+",
"+object.sunrise+","+object.sunset+...
pseudo code to explain my self better. I'm learning Java at this point in time.
if I have a method
public resultSet getEverything()
{
resultSet rs = blabla;
return rs
}
I can't rs.close() as I need to use it in the method I retrieve it
hence then I will use it, and maybe 'close' the new resultSet I create.
What happ...
If I run this code: http://www.danny92.pastebin.com/m1f84b972
You will see that my Database connection connects then disconnects after actionPerformed.... why? :(
...
try
{
PreparedStatement s = (PreparedStatement) conn.prepareStatement("SELECT voters.Check,count(*) FROM voting.voters where FirstName="+first+"and LastName="+last+" and SSN="+voter_ID);
//java.sql.Statement k = conn.createStatement();
rs=s.executeQuery();
//s.executeQuery("SELECT voters.Check,count(*) F...
I'm using a legacy database schema with composite keys. I have an entity with two relationships and one of the join columns is shared.
For example, Let's say i have a Student entity with two relationships Department and Course. Department uses dept_code column while Course uses dept_code and course_code colum. The domain model is such ...
Hi,
I've been reading about implicitCachingEnabled and MaxStatements with the oracle jdbc driver.
I've tried adding implicitCachingEnabled="true" into the server.xml for the datasource definition but it makes no difference.
I've also noted other posts admittedly from a long time ago, where people have failed to get this setting to wor...
Hey there,
Is it possible to update/refresh a RowSet's in case the table content is changed (for e.g. another application modifies it)? So this way I 'always' have an up-to-date version of the table.
I looked into RowSetListener, but these events seem to get invoked only if I make modifications to the RowSet directly. It would be enoug...
Hi.
Currently I'm making sort of SQL command line interface for web-based application. It should act roughly like sqlPlus.
I have encountered a problem how to execute sql's. They can be both as SQL and/or PL/SQL.
First way I thought that I can split them (by ';' or ';/') and detect separately if it's sql select or delete/update/insert ...
I'm trying to get the new rating from an UPDATE statement in java
int userID = 99;
String sql = "UPDATE table SET rating=rating+1 WHERE user_REF="+userID;
statement.executeUpdate(sql);
I can just do another SELECT statement, but isn't there a better way to retrieve the value or row while updating?
...
Hello
I'm not sure why, but for some reason, the following code skips the else condition. I've tried just about everything I can think of, including switching the code blocks, but it still skips the else part. Basically, I want this method to return String temp = "no" if String docID that is passed to the method is not found in the FILE...
I'm trying to call a PostgreSQL stored procedure from a Java app; the procedure has a DATE type parameter so I'm using a java.sql.Date type with CallableStatement.setDate(). However, executing the statement always results in an exception and the SQL logs show this:
LOG: execute <unnamed>: select * from athlete.create_athlete($1,$2,$3,...
I know that for JBoss you need a [name]-ds.xml file in the /deploy subdirectory of the appropriate instance.
i dont have any experience with other J2EE containers, but im trying to stick to standards as much as possible.
is there a standard way to define a JDBC datasource and deploy it ? if possible i'd like to include my datasource insi...
[Cross-Posting from ServerFault]
I am in a development environment, and our test Oracle 9i server has been misbehaving for a few days now. What happens is that we have our JDBC connections disconnecting after a few successful connections.
We got this box set up by our IT department and handed over to. It is 'our problem', so options li...
I have a Java application and I have to connect to a MySQL DB host in aruba.it. If I make a connection, aruba.it refuses that. How to solve this?
...
Hi.
When executing pl/sql im obtaining an error :
ORA-06550: line 1, column 316: PLS-00103: Encountered the symbol "/" The symbol "/" was ignored.
PLSQL example:
DECLARE
SQL1 VARCHAR2 (1500);
SQL2 VARCHAR2 (1500);
BEGIN
SQL1 := 'INSERT INTO das_html_caption VALUES (''test_test'')';
SQL2 := 'DELETE FROM das_html...
I have two result sets (rs1 and rs2) having same fields. Now how to combine those two result sets into one so that duplicate rows are shown once.
...