> does anyone have a good example using a javabean to establish connection to > a datebase. im trying to figure out the best way to reuse code. i can try > one of the following methods:
Check out test java files that came with mysql or postgres. I know mysql has one. You can easily covert it for your own use. > 1: i dont use javabeans and put all my connetion and queries inside the jsp > pages. So if i query the database three times in one jsp page, i have 3 > duplications. I don't really like the idea of using jsp. Simplify it by using include or do a jsp function, if you are not doing it. > 2: is what im trying to do is make a general java bean that makes connection > and puts the recordset into a hash table. Humm. Never done it. But get recordset from sql query than put the entire object into hastable with key using a hashtable's put and get. Shouldn't be hard to do it. Read about hashtable in javadoc. GL. Any reason, why you want to put rs into hashtable. henry --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]