The first question is - what are you trying to do? The questions you ask likely do not solve the problem or answer the question you may have.
If this is your own transaction in Bitcoin-Qt, you can get information about the block it was included in with the console command:
gettransaction 5602487e624ee14193f646e29a9ac203335bc962b30155b66d142ab15f79018c
{
"amount" : 0.10000000,
"fee" : -0.0001000,
"confirmations" : 3592,
"blockhash" : "00000000000000040e4c97bace0df699cabdf5ef68dce31ed62a07fdcb576e6b",
"blockindex" : 22,
"blocktime" : 1387048657,
"txid" : "5602487e624ee14193f646e29a9ac203335bc962b30155b66d142ab15f79018c",
"time" : 1387048401,
"timereceived" : 1387048401, ...
(fake example information above)
If it is an unspent transaction, you can get the transaction itself, but not information about the blockchain:
getrawtransaction 5602487e624ee14193f646e29a9ac203335bc962b30155b66d142ab15f79018c
010000000112e3e4d6554d49d58bb2ebea92cf503c478f3f4c9ac67089644521a7ef41da6000000 0006a47304402207b66a4d39a5e37e501afa84b6499e47928ef2e38bcc09ff079aa9ac08025ddd3 0220378843c39ec76d5f587e3d055a0df0422e66c7e0f6567d38537f59e67938ec8901210217231 bb72798cb5d42b77b8dec1831adf52cdc5a02d23684dd4827c28197a65effffffff021458725800 0000001976a914a41de2dfd3a06aa6ff11e6ff77cd7241df805b0788ac00c2eb0b000000001976a 914ece1ef04103991b1d1241209a37f5d6b84b906fd88ac00000000
Bitcoin does not store a database with more information than it needs to operate, you need to use other tools or a modified Bitcoin to make general queries about other's old transaction information.
You can just put the transaction hash in the front page search box of blockchain.info if you want to find out what block it was included in.