[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql-java
Subject: RE: Passing variables
From: JR Ruggentaler <jr () mpv ! com>
Date: 2002-04-15 17:06:42
[Download RAW message or body]
PreparedStatement ps = Connection.prepareStatement(INSERT IGNORE INTO
APPStates "+
"VALUES (?, ?)
ps.setString(1, "key");
ps.setBytes(1, "theState");
ps.executeUpdate();
J.R.
-----Original Message-----
From: Adnan Al-bar [mailto:aalbar@cogs.susx.ac.uk]
Sent: Monday, April 15, 2002 11:37 AM
To: java@lists.mysql.com
Subject: Passing variables
Hello All,
I am writing a state server which keep application states into a database.
When I write the insert statement in an executeUpdate method how can I pass
values in as variables?
Here is my code:
stmt = dcon.createStatement();
stmt.executeUpdate("INSERT IGNORE INTO APPStates "+
"VALUES ('"key"', '"theState"')");
where key is a String type and theState is a byte[] type.
Any help please?
Thank you.
Albar
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail java-thread3604@lists.mysql.com
To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail java-unsubscribe@lists.mysql.com instead.
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail java-thread3607@lists.mysql.com
To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail java-unsubscribe@lists.mysql.com instead.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic