Re: preparedStatement

2003-02-27 Thread Bryan LaPlante
. 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

Re: preparedStatement

2003-02-27 Thread Adrian Janssen
-- > 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

Re: preparedStatement

2003-02-26 Thread Bryan LaPlante
//.. 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"

Re: preparedStatement

2003-02-26 Thread Balamurugan . R
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

Re: preparedStatement

2003-02-26 Thread Shahata, Ash
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

Re: preparedStatement

2003-02-26 Thread Jayant Kataria
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&#

Re: preparedStatement

2003-02-26 Thread Shahata, Ash
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

Re: preparedStatement

2003-02-26 Thread Jayant Kataria
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

Re: preparedStatement

2003-02-26 Thread Abdul jeelani
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,

Re: preparedStatement

2003-02-26 Thread Shahata, Ash
:[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

SV: preparedStatement

2003-02-26 Thread Mathias Höggren
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

Re: preparedStatement

2003-02-26 Thread Shahata, Ash
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

Re: preparedStatement

2003-02-26 Thread Laxmikanth M.S.
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

Re: preparedStatement

2003-02-26 Thread Pillai Jaideep, App Spec, SCS-SD
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

preparedStatement

2003-02-26 Thread Shahata, Ash
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

Re: PreparedStatement Error

2002-05-07 Thread Greg Dunn
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

PreparedStatement Error

2002-05-07 Thread Emmanuel Eze
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

Re: PreparedStatement vs Statement

2002-05-03 Thread Ashwani Kalra
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

Re: PreparedStatement vs Statement

2002-05-03 Thread Geert Van Damme
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 > > &

Re: PreparedStatement vs Statement

2002-05-03 Thread Ashwani Kalra
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

Re: PreparedStatement vs Statement

2002-05-03 Thread Geert Van Damme
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

Re: PreparedStatement vs Statement

2002-05-03 Thread Ashwani Kalra
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:

Re: PreparedStatement vs Statement

2002-05-03 Thread Peter Dolukhanov
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

Re: PreparedStatement vs Statement

2002-05-03 Thread Geert Van Damme
> 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 =

Re: PreparedStatement vs Statement

2002-05-03 Thread Ashwani Kalra
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

Re: PreparedStatement vs Statement

2002-05-02 Thread Geert Van Damme
: 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

Re: PreparedStatement vs Statement

2002-05-02 Thread Jeff Schnitzer
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

Re: PreparedStatement vs Statement

2002-05-02 Thread Ashwani Kalra
/ ~ - 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

Re: PreparedStatement vs Statement

2002-05-02 Thread suresh kumar Durairaj
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

PreparedStatement vs Statement

2002-05-02 Thread Lai, Kenny
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

Re: SQL insert with preparedStatement

2002-01-07 Thread Swart, James (Jim) %
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

Antwort: SQL insert with preparedStatement

2002-01-07 Thread M. Balle
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

Re: SQL insert with preparedStatement

2002-01-07 Thread Tiffany C.
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

Re: SQL insert with preparedStatement

2002-01-07 Thread Chen, Gin
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

Re: SQL insert with preparedStatement

2002-01-07 Thread Louis Voo
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

Re: SQL insert with preparedStatement

2002-01-07 Thread Daniel Jaffa
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

SQL insert with preparedStatement

2002-01-07 Thread Tiffany C.
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

FW: [OffTopic] ORDER BY in PreparedStatement

2001-11-28 Thread David Nguyen
-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

Re: [OffTopic] ORDER BY in PreparedStatement

2001-11-28 Thread Chen, Gin
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

[OffTopic] ORDER BY in PreparedStatement

2001-11-28 Thread Mattias Jiderhamn
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

Re: using "like" statement wih preparedStatement (EJBs?)

2001-02-09 Thread Joseph Ottinger
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

Re: using "like" statement wih preparedStatement

2001-02-08 Thread Roland Dong
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

Re: using "like" statement wih preparedStatement

2001-02-08 Thread Joseph Ottinger
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

Re: using "like" statement wih preparedStatement

2001-02-08 Thread Jay H. Lang
- 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

using "like" statement wih preparedStatement

2001-02-08 Thread blueless
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

Re: setNull function of the preparedstatement

2001-01-25 Thread Henrik
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]

Re: setNull function of the preparedstatement

2001-01-24 Thread Artigas, Ricardo Y.
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

setNull function of the preparedstatement

2001-01-24 Thread Kishor K
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

Re: How to set String values in PreparedStatement?

2000-07-11 Thread Sanjay Kumar
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

Re: How to set String values in PreparedStatement?

2000-07-11 Thread Sanjay Kumar
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

How to set String values in PreparedStatement?

2000-07-11 Thread Rathinavel Palaniappan
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

Re: PreparedStatement and Connection Pools

2000-06-24 Thread Gunaseelan Nagarajan
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

Re: PreparedStatement and Connection Pools

2000-06-24 Thread Craig R. McClanahan
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

Re: PreparedStatement and Connection Pools

2000-06-24 Thread Geert Van Damme
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

PreparedStatement and Connection Pools

2000-06-24 Thread Dave Ford
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