| Author |
Save QueryString as String ?
|
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
|
|
With
all sql-statements are printed to my console. This is fine.
But how can I save that sql-string in a common String value?
Something like:
Any Ideas??
|
 |
M K Rayapudi
Ranch Hand
Joined: Feb 19, 2007
Posts: 157
|
|
|
configure a file appender
|
R6i
|
 |
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
|
|
So I have to configure a FileAppender (via log4j),
write the query statements to that file and read that statements from the file again?
Not very conveniently? Is there no other way to get the string value (what Hibernate, JPA) in a direct way?
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
Why use a FileAppender? Just write a custom appender and have that communicate with your code.
There is no way to get Hibernate to do this for you. Doing anything (beyond logging) with the SQL generated by your JPA implementation kind of doesn't make sense which is probably why there is no out the box way of doing it.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
|
|
hello,
custom file appender..I must admit I do not have great knowledge about such things..but I will learn
http://www.javaworld.com/javaworld/jw-12-2004/jw-1220-toolbox.html?page=1
thanks.
|
 |
 |
|
|
subject: Save QueryString as String ?
|
|
|