I’m storing two dates in the PostgreSQL database. First, is the data of visit of a webpage, and the second date is the date of last modification of the webpage(this is get as a long). I have some doubts what is the best strategy to store these values. I only need day/month/year and hour:seconds and this will only for statistical
Tag: jdbc
JDBC SQLServerException: “This driver is not configured for integrated authentication.”
I am writing a “server-side extension” for SmartFoxServer (SFS). In my login script, I need to make a connection to MS SQL Server, which I am attempting to do using JDBC. I have tested the JDBC code in my debug environment, and it works fine. BUT When I put the server-side extension in the SFS “extensions” folder (as per spec),
JDBC connection to SQL Server 2005 Instance running on remote machine
I am trying to connect to sql server 2005 instance running on a remote machine from my spring web application. This web application is running in tomcat server. Earlier When I connected to sql server 2000, it worked fine. I used msbase.jar, mssqlserver.jar, msutil.jar to connect to sql server 2000. My connection String was But now when I try to
What is the difference between JDBC and JDBI?
I want to know about the differences between JDBC and JDBI in java. In particular, which one is generally better and why? Answer (I am the primary author of jDBI) jDBI is a convenience library built on top of JDBC. JDBC works very well but generally seems to optimize for the database vendors (driver writers) over the users. jDBI attempts
How to start a transaction in JDBC?
Connection.setTransactionIsolation(int) warns: Note: If this method is called during a transaction, the result is implementation-defined. This bring up the question: how do you begin a transaction in JDBC? It’s clear how to end a transaction, but not how to begin it. If a Connection starts inside in a transaction, how are we supposed to invoke Connection.setTransactionIsolation(int) outside of a transaction
Java: Insert multiple rows into MySQL with PreparedStatement
I want to insert multiple rows into a MySQL table at once using Java. The number of rows is dynamic. In the past I was doing… I’d like to optimize this to use the MySQL-supported syntax: but with a PreparedStatement I don’t know of any way to do this since I don’t know beforehand how many elements array will contain.
What type of data structure should I use to hold table rows?
I’m new to Java and just getting into querying databases. So far I have my results in a ResultSetMetaData. I’m think that for each row in the dataset I should add it to some form of collection? Can anyone tell me the best practice for this? Thanks, Jonesy Answer Usually we have a class with fields that correspond to a
java.sql.SQLException: Exhausted Resultset
I get the error java.sql.SQLException: Exhausted ResultSet to run a query against an Oracle database. The connection is via a connection pool defined in Websphere. The code executed is as follows: I note that the resultset contains data (rs.next ()) Thanks Answer I’ve seen this error while trying to access a column value after processing the resultset. Hope this will
How to set application name with JPA (EclipseLink)?
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/Configuring_a_EclipseLink_JPA_Application_(ELUG) it does not show any
Oracle doesn’t remove cursors after closing result set
Note: we reuse single connection. Answer The init.ora parameter open_cursors defines the maximum of opened cursors a session can have at once. It has a default value of 50. If the application exceeds this number the error “ORA-01000: maximum open cursors exceeded” is raised. Therefore it’s mandatory to close the JDBC resources when they are not needed any longer, in