This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes jdbc-servlets (Insert record into file) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "jdbc-servlets (Insert record into file)" Watch "jdbc-servlets (Insert record into file)" New topic
Author

jdbc-servlets (Insert record into file)

Joe Lopes
Greenhorn

Joined: Dec 27, 2000
Posts: 4
Hi friend,
I have wrote servlet program with JDBC and wanted to insert a record into my log file using sql statement.
I wanted to insert program variable field values into file field.
e.g.
Pgm Variable
String user = "Joe";
String add="address";
Sql Statement
"Insert into log (name, address) values(<user>, <add>)";
How do I insert value from user & add variable into log file in name and address field. what is the syntax.
Thank you very much and appreciate quick response as I am developing the pgm and stuck with above problem.
Joe Lopes.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You have to build a String:
String s = "Insert into log (name, address) values(" + user + " ," + add + " )";

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdbc-servlets (Insert record into file)