Tagged Questions
0
votes
1answer
30 views
SQLite java.lang.NullPointerException in only select query
i added sqlite-jdbc-3.7.2.jar to build path. I used insert query. when i opened the wellec.db with notepad, i can see records. But my select is not working.
HERE WellInfo class properties
public ...
0
votes
0answers
47 views
Weird acting while loop
Alright I have started on a Java program that reads from a database of payments, if these payments are unpaid then the program is to send alert messages (via e-mail) to the user (for testing purposes ...
0
votes
0answers
30 views
jdbc connection error: not associated with a managed connection
My application is trowing the following exception:
java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@4fe91321
...
0
votes
2answers
22 views
POSTGRES :: Updating when SQLException on insert
I'm new on Postgres. I'm trying to perform the following code (that works with MySQL) using java / postgres jdbc:
for (int i = 0; i < arr.size(); i++)
{
dtoIdent ident = arr.get(i);
...
0
votes
0answers
16 views
Memory Leak in JdbcRowSet
I try to populate a JdbcRowSet with records from a large table (some ten thousand records). I tried two variations (see code below):
Create a connection object, Instantiate using ...
2
votes
2answers
48 views
Connecting to PostgreSQL in java app engine
I'm trying to connect to PostgreSQL server from java app engine.
On my local machine code works perfectly, but when I deploy code to appengine, I get this exception:
Uncaught exception from servlet
...
0
votes
0answers
69 views
Iterating through ~4k rows in a ResultSet is acting weird not returning the correct results:
I am somewhat lost here ... I use an Oracle JDBC driver (ojdbc6.jar) to establish a connection to an oracle 11 database in an Java 7 application.
My "outer statement" fetches a lot of ids and some ...
1
vote
1answer
36 views
Excluding Foreign Keys From Being Included in a JTable Displaying a ResultSet
I have a JTable with a default table model which I am using to display a result set. I am using postgreSQL. I am trying to get the table to exclude Primary and foreign keys. So far I have gotten it to ...
0
votes
2answers
40 views
select count() returns Exhausted Resultset
I do a simple select count:
woCount = db.select("SELECT count(foo) as bar from baz");
retval = woCount.rs.getInt("bar");
The retval line throws Exhausted Resultset exception. How would that be ...
0
votes
1answer
23 views
Error in connecting SpringMVC with JDBC using net.sourceforge.jtds.jdbc.Driver
I'm trying to do SpringMVC with JDBC Template.(SQL SERVER 2008 Database is used)
I inculded all jars needed to connect database.
Here is my DB connection bean coding
<!-- declare datasource bean ...
0
votes
0answers
52 views
PIN number verify in text field . Please check if i am correct
I am writing a code to enter a number (pin code) in textfield and search weather the number is present in database or not and if present redirect to some other page else display incorrect password. ...
1
vote
6answers
50 views
How to test connection to Oracle Database using Java
Is there a way to test my connection to oracle database using Java? Here's my code.
public class OracleConnection {
public static void main(String[] args) throws Exception {
//connect to ...
-1
votes
0answers
11 views
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'product' available as request attribute
my controller program
public class ProductController extends SimpleFormController {
public ProductController(){
this.setCommandClass(ProductCommandBean.class);
...
1
vote
3answers
30 views
return a query SELECT statement
Im trying to return all the id from authors Table... but isnt working... Just returning me the first ID... But if i delete the return and put to Print, that give me all IDs..
String url = ...
1
vote
1answer
16 views
running 32 bit jvm alongside 64 bit jvm in eclipse
I am trying to create a connection to a 32 bit Microsoft access 2010 database using Java and 64 bit eclipse eclipse in windows 7.
I created a 32 bit system dns by reading this link. The program to ...
0
votes
1answer
24 views
java connection to ms access 2010 database in windows 7
I am using this tutorial to create a database connection from a java application to a Microsoft Access 2010 database. The tutorial creates a system dsn in windows, and then connects to that system dsn ...
-1
votes
1answer
42 views
fireTableRowsInserted( int , int ) Not work (GUI needs to be re-open)
public class UserPage extends JFrame implements ActionListener {
JTable table;
UserModel model;
private JButton addButton;
public UserPage() {
UserJDBC userJDBC = new UserJDBC();
model = ...
0
votes
0answers
41 views
Apache tomcat error with jdbc
I have a question in reference to Apache Tomcat. I thought I knew what the issue was, but I will ask anyone who knows as a reference.
I am working on a web application that makes numerous database ...
1
vote
1answer
27 views
Using hibernate and ms sql server driver
Microsoft doesn't supply jdbc jar to central maven repository. It needs register driver manually.
But I make something wrong. I saw same exception trace:
Initial SessionFactory creation ...
0
votes
0answers
21 views
H2 on Tomcat shutdown hanging, memory leak when using Tomcat Datasource
This is related to these 2 posts:
What is the proper way to close H2?
Tomcat doesn't stop. How can I debug this?
Basically H2 keeps a lock on the database, even when all connections are ...
0
votes
0answers
26 views
Forming a parent child structure using the data from the result set
I am developing a webpage where the user can able to select the list of options based on the category.So a parent node has the category and the child node has the list of options to select using a ...
0
votes
3answers
23 views
JAVA ODBC scroll error despite TYPE_SCROLL_SENSITIVE
I have a JAVA project involving a ODBC database query in which I need to move the cursor in the result set. I've declared the type of ResultSet to be TYPE_SCROLL_SENSITIVE, but when I execute the ...
0
votes
1answer
34 views
New ResultSet with a where, or move cursor to beginning and check condition manually
I am going to be given a staging table, which I run a process to load the data into a bigger table, and remove data from the staging table. Some rows in the staging table, denote deletions of rows in ...
0
votes
1answer
44 views
Cleaning up connection pool before Java process exit
I have a java application that gets called from a script every few minutes. The flow is:
Script invokes java process every few minutes.
The java program runs for a few minutes (sometimes less), ...
0
votes
1answer
20 views
Tomcat JDBC Count failed Logins
I am currently trying to find the best method for counting failed login attempts in my database when logging in via JDBC connection in tomcat.
Has anyone ever used this method before? I don't really ...
0
votes
1answer
30 views
how to store data from excel sheet into mysql database using jdbc connection
I have written the code for access data from Excel sheet but
i am not able to store into database using JDBC .
my code for access data from excel sheet
try{
List list=new ...
0
votes
1answer
28 views
Trying to set up Java DB: “Class Not Found: JDBC driver org.apache.derby.jdbc.EmbeddedDriver could not be loaded”
I'm completely new to SQL, and I'm trying to set up a database to practice using it.
I'm on Windows 7.
I'm following Oracle's JDBC Basics tutorial ...
0
votes
2answers
25 views
Printing the preparedStatement SQL after the bind for Oracle jdbc driver
I have tried several examples , but none of them seem to work. Here is the code I tried last
import oracle.jdbc.driver.OracleDriver;
PreparedStatement prs = null;
ResultSet rrs = null;
Class stmt1 ...
-1
votes
1answer
54 views
Getting the values from dynamically added rows and storing into database
Here is my jsp code am adding the rows dynamically by using javascript with name particulars and amount how to get this dynamically added rows values into the database and here am passing through ...
0
votes
1answer
21 views
Get all foreign keys using JDBC
I am using postgreSQL. I am trying to get all of the foreign keys from a table. This is the method that I am currently using.
public String getFKeyData(String tableName, int i) throws SQLException {
...
-3
votes
2answers
53 views
PreparedStatement.executeQuery() not returning resultset
I am using preparedStatement to insert data. I am using its executeQuery() method which returns resultSet of data just created by the Query. But I am getting exception saying you should use statement ...
0
votes
1answer
43 views
How to copy structure of database in newly created database in MySQL through java code?
I have already created one MySQL database.Now i want to create another MySQL database with same structure without data through java code(without create database,table queries in java) like export or ...
-1
votes
2answers
35 views
Form elements not being read by the controller method java ee sql
My form parameters are not loading data into the controller, I'm getting this message in the console:
INSERT INTO Products (code, cateogyr_code, product_category, product_name, description, price) ...
0
votes
0answers
26 views
Slow connection in case of SQLite JDBC
I have a Java code that works with SQLite in the following way:
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException ex) {
// ...
}
try {
conn = ...
0
votes
0answers
42 views
oracle.jdbc.driver.OraclePreparedStatement error in java application
When I try to insert some values from a jsp page into oracle database, sometimes I get exception that prohibits the insertion. But I do not get this error most of the time I try to insert values in ...
-1
votes
0answers
10 views
SYBASE - com.sybase.jdbc2.utils.UnimplementedOperationException
Am receiving the Below Error,while trying to connect my application to Sybase DB. There are no google Answers i found for this Error, Kindly help me.
...
-2
votes
2answers
33 views
mutiple query with jdbc
I want to use two queries from the same database but I get the error:
java.sql.SQLException: After end of result set
How do I avoid this problem? Note that every table doesn't have same rows ...
0
votes
0answers
34 views
Oracle database : How to get username used to connect to Oracle database using JDBC
I wish to know whether Oracle logs the username used for the Oracle connection using JDBC in some log file.
From direct Oracle connection, I see the username getting logged in the listerner.log :
...
0
votes
3answers
19 views
Fetching record of integer type Using WHERE clause that matches part of the value provided as input
MySql+java
I want to retrieve records using WHERE clause
column: SecCode int(11) have values like this, 221101101, 221101102, 221302551, so on....
i am passing query as below:
query = "select ...
-1
votes
1answer
53 views
Singleton DB Connection [on hold]
Can you please explain how singleton is use full for creating database connection?
How it will work in multithreaded environment while creating db connection and closing the connection? Once ...
1
vote
1answer
34 views
Connection closed exception after first query
I have written a web service using JAX-WS in GlassFish. I get database connection from datasource and pass it to jOOQ.
Context context = new InitialContext();
DataSource dataSource = (DataSource) ...
-1
votes
1answer
29 views
error when using jdbc.app.DB2Driver
I install db2 expressC 10.5 in an Arch Linux (in virtual machine). Then i try to use COM.ibm.db2.jdbc.app.DB2Driver to connect to the DB2. All the results are class not found or driver not found. Here ...
0
votes
2answers
42 views
PreparedStatement does not work with mysql/JDBC
I tried to insert a userId (int) and a userName(String) using the PreparedStatement using JDBC using the following method:
public boolean saveUser(int userId, String userName){
boolean saveStatus ...
1
vote
3answers
63 views
Progress bar for MySQL connection
I am using JDBC to link my program to MySQL.
I noticed that establishing a connection to MySQL can take about 6-10 seconds.
I want to use a JProgressBar to show the progress of the connection so that ...
0
votes
2answers
47 views
Java Swing jComboBox not filling from Database
So I am working on a task force schedule for my mothers charity project. The aim is to check in the volunteers, display the roster for times and what station they are at. I have successfully built a ...
0
votes
1answer
32 views
oracle 10g express edition database connection
I am trying to add a from data to database
and loaded class 12 drivers,tried ojdbc14 and ojdbc14_g too getting following errors
protected void doPost(HttpServletRequest request, HttpServletResponse ...
0
votes
2answers
63 views
SQL JDBC JAVA: getGeneratedKeys() after IF NOT EXISTS ( SELECT …) INSERT INTO (…)
I am now searching for a while not finding a solution for my problem.
I would like to insert a new row into a table if it currently not exists. I need the auto-incremented key of that new entry or the ...
0
votes
1answer
40 views
JDBC RowSets using singleton Connection
I'm using javax.sql.rowset.JdbcRowSet and com.sun.rowset.JdbcRowSetImpl to manipulate data. Everything works fine, but I'm getting a warning that I might get a resource leak.
Also, I'm using ...
0
votes
1answer
28 views
setSavepoint method in Java
Directly from this API:
Savepoint setSavepoint(String name) throws SQLException
Creates a savepoint with the given name in the current transaction and returns the >new Savepoint object that ...
0
votes
2answers
50 views
ClassNotFoundException: net.sourceforge.jtds.jdbc.Driver
I have java code which connects to a MS-SQL database and procures some data.
Before running the code I set the class path in the Unix Server and it used to work fine.
But for some reason the same ...