jdbc problem

Seite 1 von 1 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/jdbc_problem_99662/page_1 - zur Vollversion wechseln!


sensei schrieb am 26.11.2003 um 10:02

folgendes problem:

ich will in eine Datenbank ein Tupel einfügen
z.B.:

creaStmt.executeUpdate("insert into test values ('hallo', 'Harald')"); // kein problem
aber ich will das ganze mit strings, später mit einem userobjekt befüllen, und ich schaffs nicht mal mit strings...

String a ="hallo";
String b ="Harald";
creaStmt.executeUpdate("insert into test values ("+a+", "+b+")");
geht einfach nicht :(

lösungsvorschlag?

tia


murcielago schrieb am 26.11.2003 um 10:08

Code:
insert into test values ('"+a+"','"+b+"');


sensei schrieb am 26.11.2003 um 10:14

Zitat von murcielago
Code:
insert into test values ('"+a+"','"+b+"');

lol

thx, man bin ich doof, auf das wär ich nie kommen!




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2025