File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
Joined: Aug 19, 2007
Aug 27, 2007 02:22:00
First of all thanking you to all of members to sending response to
my previous doubts.
I have some problem with the following code.
Though it is compiling and running, it gives false results.
First of all CODE is:
public class sample
rs=st.executeQuery("select * from uin where NUM='"+ UIN +"'");
System.out.println("Record is already exist");
ps=con.prepareStatement("insert into uin values(?)");
System.out.println("Number inserted Successfully:");
public static void main(String args)
sample s=new sample();
The above code is working.It always displays "Record is already exist".
If i doesn't have any records in my database it always dispalys the above code.
But i doesn't know wheter it is coding problem or driver problem.
programs are working properly in my system.
please clarify my doubt.
Joined: Nov 29, 2005
Aug 27, 2007 03:56:00
resultset would never be null , even if it doesn't have any record in it.
For more information related to this check javadoc.
subject: JDBC Doubt
Doubt in the following code
Runtime.exec() in Java not working in Oracle 10 Application Server
Doubt in JDBC
doubt in update
Database access, potential threading problem?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014