4
   

Does it mean that it assigns value of parameter to String - variable?

 
 
Reply Wed 22 Feb, 2012 01:33 pm
What does following method do( look at http://docs.oracle.com/javase/6/docs/api/ -> PreparedStatement -class)
setString(int parameterIndex, String x)
Sets the designated parameter to the given Java String value.
Does it mean that it assigns value of parameter to String - variable?
 
FreeDuck
 
  2  
Reply Wed 22 Feb, 2012 01:40 pm
@alvoutila,
It binds the value of the variable to the prepared statement parameter ('?').
sozobe
 
  1  
Reply Wed 22 Feb, 2012 01:43 pm
@FreeDuck,
FREEEEEEEEEEEEEEEEDUUUUUUUUUUCK!

Hi!

(Sorry to be off-topic alvoutila, hope that the Genius Duck's answer helped, I'd guess so.)
FreeDuck
 
  1  
Reply Wed 22 Feb, 2012 01:47 pm
@sozobe,
Soz-ooooo-beeee! Hi yourself! Good to see your avatar.
roger
 
  1  
Reply Wed 22 Feb, 2012 01:54 pm
@sozobe,
Also off topic, but. . . .

Welcome home, FreeDuck
0 Replies
 
Region Philbis
 
  1  
Reply Wed 22 Feb, 2012 01:55 pm
@FreeDuck,

an honest-to-goodness FD sighting... Smile
0 Replies
 
alvoutila
 
  1  
Reply Wed 22 Feb, 2012 01:58 pm
@FreeDuck,
Do you mean that parameter( eq. 1) = variable(eq. sname) or variable = parameter?
FreeDuck
 
  2  
Reply Wed 22 Feb, 2012 02:36 pm
@alvoutila,
It's a prepared statement parameter. Look at the example at the top of the javadoc and you'll see little question marks in the sql. That method takes the value of the string variable and puts it in place of that question mark in the statement.

** Hi my friends! Good to see everyone!
DrewDad
 
  1  
Reply Wed 22 Feb, 2012 04:22 pm
@FreeDuck,
Howdy!
ossobuco
 
  1  
Reply Wed 22 Feb, 2012 04:40 pm
@DrewDad,
Piling on, hi, ducky!
0 Replies
 
FreeDuck
 
  3  
Reply Wed 22 Feb, 2012 09:26 pm
Howdy my friends! (My apologies, alvoutila.) I had to come back. Can't really talk politics on Facebook with family and coworkers. Or at least, I really shouldn't. Smile
0 Replies
 
 

Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
 
  1. Forums
  2. » Does it mean that it assigns value of parameter to String - variable?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 6.98 seconds on 12/21/2024 at 07:00:06