Hey y'all,
I'm trying to add a database-enabled JSP to an existing Tomcat 5.5 application (GeoServer 2.0.0, if that helps).
The app itself talks to Postgres just fine, so I know that the database is up, user can access it, all that good stuff. What I'm trying to do is a database query in a JSP that I've added. I've used the config exam...
Hi, I have a stored procedure in an Oracle 10g database, in my java code, i call it with:
CallableStatement cs = bdr.prepareCall("Begin ADMBAS01.pck_basilea_reportes.cargar_reporte(?,?,?,?,?); END;", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
cs.setInt(1, this.reportNumber);
cs.registerOutParameter(2, Oracle...
I would need to implement cache, which would need to perform SQL queries and cache results. So, I would love to read something about best practices of doing that; how do properly, staling cache results, checking, etc.
Particularly, I would probably benefit from learning how Hibernate is doing that? Or some other good players :-)
...
I want to INSERT a record in a database (which is Microsoft SQL Server in my case) using JDBC in Java. At the same time, I want to obtain the insert ID. How can I achieve this using JDBC API?
...
Hi,
I would like to call this stored procedure with jdbc:
sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
JDBC thinks the ? is a placeholder for an argument. In fact it is used by the SP to put in the table name. How can I call the stored procedure? I tried this:
CallableStatement call = jdbcConnection.prepareCall("call sp_m...
I need a database connection in Java Web service implemented as a session bean, and I'm not sure if I do it right.
I created a class
public final class SQLUtils {
//.....
private static DataSource m_ds=null;
static
{
try
{
InitialContext ic = new InitialContext();
...
I have lots of method in my database class that all of them have one statement, when should I close the connection? In each method or at the end of database class?
...
Hi, using CFMX7 and Oracle 10g ent on a query-intensive and active web site, I'm having a problem that some of the Oracle connections in my web server connection pool are accumulating open cursors. (In JDBC parlance this might be called a ResultSet object leak.)
This is a confusing situation in Oracle; read here for an explanation.
htt...
I am currently retrieving both a UserTransaction and a DataSource from a Weblogic 10.3 server using JNDI.
I have set the Datasource up to 'Support Global Transactions' and to use 'Logging Last Resource'
My hope was that by beginning a UserTranscation and then retrieving a JDBC connection from the Datasource the connection would partici...
Also; can I add a negative INT inside a PRIMARY KEY column inside a table via JDBC?
...
I need a JDBC driver for MsAccess to be used in a Unix environment
I would strongly prefer it to be an open-source
Also it should support SQL statements
(Jackcess came close to being my choice- but it doesn't support SQL queries)
http://jackcess.sourceforge.net/faq.html#query
...
I am learning about the wonders of JdbcTemplate and NamedParameterJdbcTemplate. I like what I see, but is there any easy way to see the underlying SQL that it ends up executing? I'd like to see this for debug purposes (in order to for example debug the resulting SQL in an outside tool).
...
Hi all
I have an application on Glassfish v2 ( on Mac OS 10.5.8 and Java 1.6 ) that uses JavaDB and Toplinks that comes with the Glassfish bundle. Everything works fine.
I have installed PostgreSQL 8.4 and the JDBC v4 driver. Both Glassfish and Postgres server run on localhost. From Netbeans, I create a connection to a database on the P...
Hi
I am starter and i want to know how to find a specific column is a FOREIGN KEY column in the database.
what i am doing is.....
I am getting a connection object from a specific data source. Using this connection object i am trying to get all the metadata of that specific datasource using DatabaseMetadata. I worked on getColumns, get...
I have a table with a DATE column with time (as usual in Oracle since there isn't a TIME type). When I query that column from JDBC, I have two options:
Manually convert the values with Oracle's to_date()
Use a java.sql.Timestamp
Both approaches work and have exclusive areas of hideousness. My problem is when I'm SELECTing data. Here ...
How can I do the username and password authentication(the username and the password is stored in the database then contact with the database to validate if the username and the password is valid or not. If the username and the password is valid then show the next page otherwise show the same login page with error message)
...
I'm connecting to SQL Server (2005) through Java using the Microsoft SQL Server JDBC Driver 2.0.
How do I get the return value from a stored procedure? I'm doing something like:
Connection connection = dataSource.getConnection()
CallableStatement proc = connection.prepareCall("{ call dbo.mySproc() }");
proc.execute();
Should I be us...
I have discovered recently that's possible to call anoymous blocks from jdbc like this:
String plsql = "BEGIN" +
" :result := foobar( booleanparameter => :mypar > 2);" +
"END;";
con.prepareCall(plsql);
Which is great, because I can use this to "wrap" some function calls and
overcome some...
Hi All,
We have 4 stored procedures which we are using to insert the entries in database, These 4 are interdependent, If any of this fails Whole operation has to be rolled back, only if everything goes well I want to commit the transaction. How do I achieve that.
Thanks,
Rohit.
...
Hello All,
My application currently relies on JDBC realm authentication. Recent needs have forced us to think about having LDAP authentication as well. We are thinking about using Active Directory for both authentication as well as authorization (roles). As a standalone test, I was able to authenticate my application with AD. But here i...