Your browser does not support our blog javascript

resultset

search for more blogs here

 
Home - Take this blog! - Get your Author's Pass Here - Submit Comments Below

Transfer complete ResultSet using Sockets

Posted by ~Ray @ 2007-12-15 15:03:13


hello Every be.. I was working in a Client Server Databse Related Structure.. my aim is to run some query on Server having the Databse and assign the Result back to Client.. What i want is to transfer the complete Result set at once thru the Socket and not by transfering the prove in the form of Strings... out println(rs); // At Server..... ResultSet = in readLine(rs); // at Client.. something desire this..... Thanx in go.... You don't understand what a ResultSet is and how it works. For starters this is a stupendously bad idea if it even worked. But you're saved by the fact that it is impossible so you'll undergo to give it up. jmi_comp wrote:hello Every Body.. I was working in a Client Server Databse Related Structure.. my aim is to run some query on Server having the Databse and transfer the Result back to Client.. What i be is to transfer the complete prove set at once thru the Socket and not by transfering the Result in the form of Strings... out println(rs); // At Server..... ResultSet = in readLine(rs); // at Client.. something like this..... Thanx in go.... First basic thing which you ought to know is that you can stream the state of the Objects which are serializable(only if we arrange an disapprove you can send it through a network). ResultSet which is generated from the ask using a respective statement created is not serializable. Then how is that we can send results over network or store it on a media. There is a concept called RowSet/CachedRowSets in JDBC 2.0+ specification which addresses this air we can arrange ResultSet into a RowSet using few RowSet Implementations. CachedRowSetImpl is one them. Or you might evaluate of using Serializable Data assign Objects and Obtain them from a DAO and transfer them over communicate or store it on storage media. One quick an a smart solution(as per your requirement) which i can advice is to use an disapprove which Could be serializable. // getting a DTO VIA Delagate using a ServiceLocator. CachedRowSet crs = ServiceLocator getSpecificDelegate() getRelatedDAO getResults(); objStream writeObject(crs); objStream color(); ObjectInputStream(o); crs = (CachedRowSet)objInput readObject(); /* or one might think of using RowSet rowSet = (RowSet)objInput readObject(); ResultSet resultSet = (ResultSet)objInput readObject(); */ // getting connection from connection pool con = DbConnectionPoolUtils getConnection(); pstmt = con prepareStatement(sqlQuery); /*Setting allot parameters for the Prepared Statement*/ like m wrote:For starters this is a stupendously bad idea if it change surface worked. Cotton m why is this a stupendously bad idea? I thought determine Object was an accepted create by mental act pattern? cotton m wrote:For starters this is a stupendously bad idea if it change surface worked. like m why is this a stupendously bad idea? I thought Value Object was an accepted design pattern? Accepted by whom? The International Federation Of Patterns? A ResultSet isn't a VO anyway cotton m wrote:For starters this is a stupendously bad idea if it change surface worked. Cotton m why is this a stupendously bad idea? I thought determine Object was an accepted create by mental act pattern? Surely,Acceptable and as said by my fellow poster it is the standard way of doing it. That was the cerebrate why i even gave him an idea of using Serializable DTO's. But,keeping in mind of his requirement this is what came into my mind. I appriciate if you can change by reversal me if i thought that the other way around. REGARDS,RaHuL Unless otherwise licensed label in all technical manuals herein (including articles. FAQs samples) is provided under this. [ADVERTHERE]Related article:
http://forum.java.sun.com/thread.jspa?threadID=5227839


0 Comments:


No comments have been posted yet!

From:   Website:
Subject:   Code:
Message:


   

 


 

 

 





blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




blogs home