Skip to content
Advertisement

Tag: jdbc

unknown database in jdbc

I am using JDBC and new to it. but I keep getting this runtime exception: Here is the gave code how do I get this code to work? I am only a beginner with JDBC…. for the above code; PASS = “passowrd”, USER = “root” I had a problem with port which it was fixed through this site thanks a

COPY FROM and C3PO connection pool in Postgres

I have the follow code in my JAVA program that allows me to copy data from a file into my Postgres database: This code works fine, but I would like to use a connection pool to manage my connections, as I have this code running for numerous files. So I used C3P0. However, when i get a connection from the

Hibernate startup very slow

For some reason, the startup of my hibernate application is unbarrably slow. (up to 2 min) I have been thinking that the c3p0 configuration is plain wrong (related question) but studying the logs shows, that there is no activity just after the connection to the server is established. Also, using the built-in polling capabilities of Hibernate shows the same result.

ResultSet getFetchSize() doesn’t seem to work?

I’m having trouble with the getFetchSize() function. I simply need to know if the SQL query has returned zero rows. I’ve tried this simple statement: where rs is of the ResultSet type. The above code doesn’t seem to work. It always prints the message whether rs is empty or not. I checked the SQL query itself and it correctly returned

How to query for a List in JdbcTemplate?

I’m using Spring’s JdbcTemplate and running a query like this: There are no named parameters being passed, however, column name, COLNAME, will be passed by the user. Questions Is there a way to have placeholders, like ? for column names? For example SELECT ? FROM TABLEA GROUP BY ? If I want to simply run the above query and get

java.sql.SQLException: Missing IN or OUT parameter at index:: 1

I made some Java 1.6-Oracle11g-JDBC (using OJDBC 6) code (below). I am getting an exception – java.sql.SQLException: Missing IN or OUT parameter at index:: 1 Why is this happening and how do I fix it ? My output is- The code is- EDIT – To correct the code, we use- //insert 1st row //insert 2nd row Answer This is not

Creating a Java Connector for Pervasive PSQL

How can I create a connector for Pervasive PSQL in Java? How can I create a connector for Pervasive PSQL? I created a sample connector, but I am not sure whether it is right or wrong. Answer Here’s a simple program I have that works for me to connect to a Pervasive PSQL database: To compile it, I use: And

Advertisement