.
fair enough, there is more than one way to skin a cat.
Bryan
- Original Message -
From: "Adrian Janssen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 4:06 AM
Subject: Re: preparedStatement
> Sorry, I did not mean to send directly to
--
> From: Bryan LaPlante [SMTP:[EMAIL PROTECTED]
> Sent: 27 February 2003 11:28
> To: Adrian Janssen
> Subject: Re: preparedStatement
>
> I am not sure what you mean, the row23 is throwing me off a bit. Do you
> mean
> that your key would be the column names and the v
//.. and so on.
- Original Message -
From: "Balamurugan . R" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 9:40 PM
Subject: Re: preparedStatement
> Use seprate statement for each resultset
>
> "Shahata, Ash"
gh a resultset more than
> once?
>
> -Original Message-
> From: Mathias Höggren [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 26, 2003 11:13 AM
> To: [EMAIL PROTECTED]
> Subject: SV: preparedStatement
>
> Hi!
>
> I strongly suspect your problem is right
yep, I am using 2 different statement, one for each result set
-Original Message-
From: Jayant Kataria [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 12:09 PM
To: [EMAIL PROTECTED]
Subject: Re: preparedStatement
Hi,
One more thing to be checked is that if we want to access
nt is lost/closed.
regards
Jayant
-Original Message-
From: Shahata, Ash [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 5:32 PM
To: [EMAIL PROTECTED]
Subject: Re: preparedStatement
I tried the result settings mentioned, however I'm still getting the same
result :( I
ubject: Re: preparedStatement
Hi,
I guess it depends on the jdbc driver of that database...
In case the driver supports then we can create scrollable result sets by
creating Statement object with appropriate constants like
ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE
whichever
rom: Abdul jeelani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 4:51 PM
To: [EMAIL PROTECTED]
Subject: Re: preparedStatement
u r right. You cannot loop thru' resultsets more than once.
Regards,
Abdul
- Original Message -
From: "Shahata, Ash" <[EMAIL PROTE
u r right. You cannot loop thru' resultsets more than once.
Regards,
Abdul
- Original Message -
From: "Shahata, Ash" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 26, 2003 4:48 PM
Subject: Re: preparedStatement
I tried this already,
:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 11:13 AM
To: [EMAIL PROTECTED]
Subject: SV: preparedStatement
Hi!
I strongly suspect your problem is right here:
if(val1 == val2){
Try this instead:
if (val1.equals(val2)) {
Brgds
Mathias
-Ursprungligt meddelande-
Från: A mailing list
februari 2003 12:09
Till: [EMAIL PROTECTED]
Ämne: Re: preparedStatement
I think I figured it out where the problem is, it'a not from the code that I
sent it's to do with the rs.next! However I still couldnt fix it. The value
of tname is passed correctly and when I retireve it on its own, it
nside rs2 Inside rs2 Inside rs2
Inside rs2 Inside rs Inside rs Inside rs
Any idea why the loop is not functioning as expected?
Thanks
-Original Message-
From: Pillai Jaideep, App Spec, SCS-SD [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 10:18 AM
To: [EMAIL PRO
what problem u r facing with this piece of code
Statement stmt = con1.createStatement();
String query = "Select * from SW_Customer where swName = ?";
PreparedStatement ps = con1.prepareStatement(query);
ps.setStri
R U sure tname variable holds exactly the value U want ?
-Original Message-
From: Shahata, Ash [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 5:50 PM
To: [EMAIL PROTECTED]
Subject: preparedStatement
Hi there,
I'm getting stuck with the following procedure using pre
ement();
String query = "Select * from SW_Customer where swName = ?";
PreparedStatement ps = con1.prepareStatement(query);
ps.setString(1,tname);
ResultSet rs = ps.executeQuery();
while (rs.next()){
String name = rs.getString(1);
out.println("Value of field = &quo
DBC driver specifically for SQL Server.
Greg
-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Emmanuel Eze
Sent: Tuesday, May 07, 2002 7:25 AM
To: [EMAIL PROTECTED]
Subject: PreparedStatement Error
I get the fo
I get the following error message when i call the setDate() method of the
PreparedStatement:
[Microsoft][ODBC SQL Server Driver]Optional feature not implemented
I am connecting to an MS SQL Server 2000 using JDBC-ODBC brige.
Does anyone know a fix?
Emma
Hi,
I saw this article
http://www.javaperformancetuning.com/tips/rawtips.shtml
which tells you
a.. Use prepared statements (PreparedStatement class) [article provides
coded example of using Statement vs. PreparedStatement].
This is very vague statement.This doesnt mean that you should use it
Query("select userName, status from
> login where
> > userName = '"+userName+"' and password = '"+password+"'");
> >
> > Now, I can login by using userName/password
> > test / test' or '1'='1
> >
&
fully instead of considering it as "default" for executing the queries.
Regds
Ashwani
- Original Message -
From: "Geert Van Damme" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 03, 2002 4:29 PM
Subject: Re: PreparedStatement vs Statement
My main point is that performance generally isn't that much an issue in
server side web development.
The difference between Statement and PreparedStatement is in the order of
nanoseconds. I'm sure it's less than 1 ms on normal hardware.
That means it would take > 1000 reques
Can you explain these four points in terms of statements/preparedstatements
specially security ,stability , correctness ?
Ashwani
- Original Message -
From: "Geert Van Damme" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 03, 2002 3:42 PM
Subject:
lto:[EMAIL PROTECTED]] On Behalf Of Jeff Schnitzer
Sent: 03 May 2002 07:02
To: [EMAIL PROTECTED]
Subject: Re: PreparedStatement vs Statement
The primary reason to use PreparedStatement has nothing to do with
performance.
When you are building your query for a Statement:
String sql = "SEL
> Performance will ofcourse play the major role in selecting
> between the two.
>
I seriously doubt that.
- Correctness
- Stability
- Security
- Maintainability
Are IMO all much more crucial than raw speed.
Geert Van Damme
=
The primary reason to use PreparedStatement has nothing to do with
performance.
Have you read the article I have sent. Some body has not made the prepared
statements just because there is problem of escaping. I have only suggested
its use only when necessary and in scenarios where you can gain
: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jeff Schnitzer
> Sent: vrijdag 3 mei 2002 8:02
> To: [EMAIL PROTECTED]
> Subject: Re: PreparedStatement vs Statement
>
>
> The primary reason to use PreparedStatement
The primary reason to use PreparedStatement has nothing to do with
performance.
When you are building your query for a Statement:
String sql = "SELECT * FROM theTable WHERE name = '" + name + "'";
What malicious code do you think could be inserted by users free to
/
~
- Original Message -
From: "suresh kumar Durairaj" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, May 03, 2002 6:51 AM
Subject: Re: PreparedStatement vs Statement
> Dear all,
>
> From the DB Perspective,
> use of Pre
ny" <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: PreparedStatement vs Statement
>Date: Thu, 2 May 2002 14:41:20 -0400
>
>is there a considerable difference, if
is there a considerable difference, if I create PreparedStatement instead of
Statement after i get my DB connection?
are there pitfalls i should be aware about (using PreparedStatement)?
kenny
===
To unsubscribe: mailto
Title: RE: SQL insert with preparedStatement
Daniel,
You don't add the column name that auto increments to your insert statements, it auto populates it. So, if you had 4 columns, and they were named "firstname, lastname, email, userid" and userid is your auto inc
Remove the column with the auto_increment from your parameterlist. the
database will do this for you.
Michael Balle
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PR
ager2, director, url, chart) VALUES (?, ?, ?, ?, ?,
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
PreparedStatement addLocation =
conn.prepareStatement(addSQL);
addLocation.setString(1, locationName);
addLocation.setString(2, region);
addLocation.setString(3, address1);
addLocation.setString(4
Or just insert a SQL Null into that field. It works the same way.
-Tim
-Original Message-
From: Daniel Jaffa [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 07, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: Re: SQL insert with preparedStatement
This is more a database question and not
CTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 07, 2002 3:18 PM
Subject: SQL insert with preparedStatement
> Hello,
>
> I'm trying to Insert a new row into a MySQL database
> using a preparedStatement. However one of the fields
> in the database is an auto_inc
uld always name the fields that you are adding.
Original Message Follows
From: "Tiffany C." <[EMAIL PROTECTED]>
Hello,
I'm trying to Insert a new row into a MySQL database
using a preparedStatement. However one of the fields
in the database is an auto_increment primary
Hello,
I'm trying to Insert a new row into a MySQL database
using a preparedStatement. However one of the fields
in the database is an auto_increment primary key. I
want to insert the all other fields into the database
and let the database enter the auto_increment primary
key. How do
-Original Message-
From: David Nguyen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 28, 2001 11:22 AM
To: [EMAIL PROTECTED]
Subject: RE: [OffTopic] ORDER BY in PreparedStatement
Mattias,
I think you can simply use Statement instead of PreparedStatement. The point
here is how to
sb.append(",?");
}
//make preparedstatement from stringbuffer
preparedStatement = conn.prepareStatement(sb.toString());
-Tim
-Original Message-
From: Mattias Jiderhamn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 28, 2001 10:38 AM
To: [E
I know this really is off topic, but with the discussion about user
authentication and PreparedStatements some two weeks ago in mind, I
thought maybe somebody here can answer a quiestion.
How do I use ORDER BY with PreparedStatement?
We use this in a web app where the user should be able to
nds, for example.)
EJBs remove the data access mechanism and focus on the data itself. One
person might populate a table by the following pseudocode:
establish connection via JDBC
build preparedstatement
establish parameters
run query
while(resultset has more data)
add to table with current rec
Just wondering why EJBs are much preferred to JDBC? Can you give an example?
Roland
You can use "like" in a prepared statement; as I recall, all you'd need is
to make sure the string you're setting has the wildcards. To wit:
PreparedStatement ps=connection.createPreparedS
ared statement; as I recall, all you'd need is
to make sure the string you're setting has the wildcards. To wit:
PreparedStatement ps=connection.createPreparedStatement(
"select * from products where name like ?");
ps.setString(1, "%"+searchName+"%");
I'v
- MQSeries
303 277-1873 - Office
303 807-9700 - Cell
blueless wrote:
> hi
> I hava problem using jdbc with SQL.
>
> I would like to use "LIKE" statement and preparedStatement for querying data.. and
>speed...
>
> But when I try it it goes an error...
>
> Exc
hi
I hava problem using jdbc with SQL.
I would like to use "LIKE" statement and preparedStatement for querying data.. and
speed...
But when I try it it goes an error...
Except using simple Statement , can I do it successful wih preparedStatement and
"LIKE" statemen
formation in this message (and any attachment thereto) that
>> do not relate to the official business of EasyCall shall be understood as
>> neither given nor endorsed by the company.
>>
>>
>> -Original Message-
>> From: Kishor K [SMTP:[EMAIL PROTECTED]
Thursday, January 25, 2001 2:45 PM
> To: [EMAIL PROTECTED]
> Subject: setNull function of the preparedstatement
>
> hi,
>
> When i tried to use the setNull function of the preparedstatement
> class to set a Date/Time field in msaccess database as null i got the
> f
hi,
When i tried to use the setNull function of the preparedstatement
class to set a Date/Time field in msaccess database as null i got the
following error.
can anyone help.
so.setNull(++j, java.sql.Types.DATE);
error- SQL data type out of range
thanx in advance
kishor
You can code as follows (using Batch Update requires JDBC 2.x supporting
driver)
// turn off autocommit
con.setAutoCommit(false);
PreparedStatement stmt = con.prepareStatement("INSERT INTO TableName VALUES
(?, ?)");
stmt.setString(1,value1a); // get values from recordset of select
Sent: Wednesday, July 12, 2000 9:46 AM
Subject: How to set String values in PreparedStatement?
> hi folks,
>
> Sorry for bit off topic question, but i hope somebody
> can thru light on it!.
>
> I have problem on setting String values in the
> prepared
hi folks,
Sorry for bit off topic question, but i hope somebody
can thru light on it!.
I have problem on setting String values in the
prepared statement.I have a sql statement
somthing like,
"insert into TableName (Name, Age, ?,?, Sponser_Name,
Sponser_coun
hi Craig,
Thanks for this good tip. I have been ignoring
prepared statements, now I know their use.
Thanks
Nagaraj.
--- "Craig R. McClanahan"
<[EMAIL PROTECTED]> wrote:
> Dave Ford wrote:
>
> > My understanding is that the benefit of a
> PreparedStatement is tha
Dave Ford wrote:
> My understanding is that the benefit of a PreparedStatement is that you
> "prepare it" ONCE and then "execute it" over and over. Thus, the server has
> a chance to optimize complicated SQL statements ahead of time. So, based on
> this reasoni
Dave Ford
> Sent: zaterdag 24 juni 2000 17:10
> To: [EMAIL PROTECTED]
> Subject: PreparedStatement and Connection Pools
>
>
> My understanding is that the benefit of a PreparedStatement is that you
> "prepare it" ONCE and then "execute it" over and over. Thus, th
My understanding is that the benefit of a PreparedStatement is that you
"prepare it" ONCE and then "execute it" over and over. Thus, the server has
a chance to optimize complicated SQL statements ahead of time. So, based on
this reasoning, one might choose to "prepare&q
55 matches
Mail list logo