473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

help with database

Hi,

I am using MS access for database.

I am using java as the programming language and able to connect to the database and insert the values into the database.

The following is the code used for inserting the values into the database:

public void storeDB (String insertSQL){
try {
Statement st = dbConn.createStatement();

st.executeUpdate(insertSQL);

} catch (Exception e) {
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}

This method is always called from main function whenever I am inserting some values into the database tables.

Now I need to perform "Select" statement where I would like to select some values from the database rows depending on the condition and then either store or return that value to my main program.

generally st.executeQuery(Select * from table_name) always returns a result set.

But I am extracting a set of integer values from a database table and would like to return each of these values or store them in a temporary variable.

How can I do that.

Pls help!!

Thanks!!
Nov 18 '07 #1
2 1215
JosAH
11,448 Expert 8TB
generally st.executeQuery(Select * from table_name) always returns a result set.

But I am extracting a set of integer values from a database table and would like to return each of these values or store them in a temporary variable.

How can I do that.

Pls help!!

Thanks!!
Read the API documentation for the ResultSet interface; it has methods that can
extract individual column values (of any type) from the rows of the set.

kind regards,

Jos
Nov 18 '07 #2
dav3
94
I highly recommend the following link. It was a great article (as is the following article on the site) on how to use JDBC

click here
Nov 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: cooldv | last post by:
i am running a website on Windows 2000 server with ASP 3 webpages and Access 2000 database. (with a hosting company) traffic is slow at this time but expect to grow. lately i have been reading...
0
by: Henry Reardon | last post by:
I just installed DB2 Personal Developer's Edition V8.2 (FP7) over my old DB2 V7.2 instance but I'm having some problems. Can anyone help? The first problem is that my migration didn't go too...
6
by: g | last post by:
Hi, I have an MS Access 2000 Database on a network. When ever 2 people use it at the same time it crashes. The database size is 14 megs. I have another database just like it...and it has not...
5
by: Bec | last post by:
I'm in desperate need of your help.. I need to build an access database and have NO idea how to do this.. Not even where to start.. It IS for school, and am not asking anyone to do my...
0
by: J. | last post by:
Hello all, I need some assistance. I've been out of the C++ game way too long and I need some help getting back up to speed. I'm taking a class where STL is mostly covered...I know alot of...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
17
by: Liam.M | last post by:
Hey guys, Forgive me if my question my be alittle silly, but I would very much appreciate and assistance that could be given! My situation is as follows: I have created a Button, and set...
5
by: AAJ | last post by:
Hi all FIRST THE BORING BITS....... I normally use a Database layer, a Business layer and a GUI layer. The GUI uses an Object data source to bind to the Business layer which in turn binds...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
0
by: GetgoodV | last post by:
Hi all, I wonder if anybody can help with a problem I have accessing (caaloging) databases on my network (drive V) I have installed DB2 V8 on Windows XP: -...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.