It might b e worth noting that you can use undocumented "don't use these and expect them to work over time" type functions to use an existing datasource, so you don't need to save your db user & pass "hard"ly.
Something like: daFactory = CreateObject ("Java"," coldfusion.server.ServiceFactory"); conn = daFactory.getDataSourceService ().getDatasource("yourDataSourceName").getConnection(); for the connection and the rest like the rest. Worth it for me, to use non public api whatnot. Be warned, may not work in the future (but there would be something else anyway ;) :de On 4/20/06, Qasim Rasheed <[EMAIL PROTECTED]> wrote: > > Jacob, > > Here is an example implementation for Oracle. You can definitely modify it > for any other database. > > <cfscript> > //connection url > connURL = "jdbc:macromedia:oracle://.........."; > jclass = createobject('java','java.lang.Class'); > jclass.forName('macromedia.jdbc.oracle.OracleDriver'); > driverManager = CreateObject('java', 'java.sql.DriverManager'); > //user name and passwword > conn = driverManager.getConnection( connURL, 'USER', 'PASSWORD' ); > sql = "delete from atable where id = ?"; > ps = conn.prepareStatement(sql); > ps.setString(1,'2'); > n = ps.executeUpdate(); > </cfscript> > <cfoutput> > Records Affected: #n# > </cfoutput> > > HTH > > Qasim > > On 4/20/06, Munson, Jacob <[EMAIL PROTECTED]> wrote: > > > > How do you do that? > > > > > -----Original Message----- > > > From: Qasim Rasheed [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, April 19, 2006 6:40 PM > > > > > > Well I have been using JDBC Statement call from CF and it > > > will return you > > > number of records effected for updated, inserts or deletes. > > > > > > ----------------- > > > > This transmission may contain information that is privileged, > confidential > > and/or exempt from disclosure under applicable law. If you are not the > > intended recipient, you are hereby notified that any disclosure, > copying, > > distribution, or use of the information contained herein (including any > > reliance thereon) is STRICTLY PROHIBITED. If you received this > transmission > > in error, please immediately contact the sender and destroy the material > in > > its entirety, whether in electronic or hard copy format. Thank you. A1. > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238460 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54