import java.io.FileOutputStream ;
import java.io.OutputStreamWriter ;
import java.io.PrintWriter ;
import java.sql.DriverManager ;
import java.sql.Connection ;
import java.sql.ResultSet ;
import java.sql.Statement ;
class SelToFile {
{
String url
= "jdbc:firebirdsql://host[:port]/<database>" ; String filename
= "result.txt" ; String sql
= "select F1 from mytable" ;
while ( rs.next ( ) ) out.println ( rs.getString ( 1 ) ) ;
rs.close ( ) ;
stmt.close ( ) ;
con.close ( ) ;
out.close ( ) ;
}
}
aW1wb3J0IGphdmEuaW8uRmlsZU91dHB1dFN0cmVhbTsKaW1wb3J0IGphdmEuaW8uT3V0cHV0U3RyZWFtV3JpdGVyOwppbXBvcnQgamF2YS5pby5QcmludFdyaXRlcjsKaW1wb3J0IGphdmEuc3FsLkRyaXZlck1hbmFnZXI7CmltcG9ydCBqYXZhLnNxbC5Db25uZWN0aW9uOwppbXBvcnQgamF2YS5zcWwuUmVzdWx0U2V0OwppbXBvcnQgamF2YS5zcWwuU3RhdGVtZW50OwoKY2xhc3MgU2VsVG9GaWxlIHsKCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB0aHJvd3MgRXhjZXB0aW9uIAoJewoJCVN0cmluZyB1cmwgPSAiamRiYzpmaXJlYmlyZHNxbDovL2hvc3RbOnBvcnRdLzxkYXRhYmFzZT4iOwoJCVN0cmluZyB1c2VybmFtZSA9ICJ1c2VyIjsKCQlTdHJpbmcgcGFzc3dvcmQgPSAicGFzc3dvcmQiOwoJCVN0cmluZyBmaWxlbmFtZSA9ICJyZXN1bHQudHh0IjsKCQlTdHJpbmcgc3FsID0gInNlbGVjdCBGMSBmcm9tIG15dGFibGUiOwoJCQoJCVByaW50V3JpdGVyIG91dCA9IG5ldyBQcmludFdyaXRlcihuZXcgT3V0cHV0U3RyZWFtV3JpdGVyKG5ldyBGaWxlT3V0cHV0U3RyZWFtKGZpbGVuYW1lKSwgIlVURi04IikpOwoJCUNvbm5lY3Rpb24gY29uID0gRHJpd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