List:MySQL and Java« Previous MessageNext Message »
From:RITESH BISWAS Date:April 30 1999 3:59am
Subject:Re: insert variables
View as plain text  

On Thu, 29 Apr 1999, Oana  Radulescu wrote:

> Hi!
> I am having difficulty creating an insert statement in Java that would
> use variable values as the values parameters.
> None of the following worked -- I would get either the name of the
> variable instead of the value or nothing at all:
> String value1 = new String("blah");
> insert into table values (value1);

Hi ,
 Try works for me...

executeUpdate("insert into table values ('"+value1+"')");

it uses + to concatenate 2 strings...even the variable.


insert variablesOana Radulescu29 Apr
  • RE: insert variablesMark Matthews29 Apr
  • Re: insert variablesRITESH BISWAS30 Apr
    • Re: insert variablesAmbrose Li30 Apr
      • Re: insert variablesmmatthew30 Apr
      • Re: insert variablesTim Endres30 Apr