Jacob,

I am glad that you found it useful and managed to translate it for SQL
server as well. I also saw you blog post about this technique.

Thanks

Qasim


On 4/20/06, Munson, Jacob <[EMAIL PROTECTED]> wrote:
>
> I got this working for MS SQL, here's the code:
>
> <cfscript>
> //connection url
> connURL = "jdbc:macromedia:sqlserver://server:1433";
> jclass = createobject('java','java.lang.Class');
> jclass.forName('macromedia.jdbc.sqlserver.SQLServerDriver');
> driverManager = CreateObject('java', 'java.sql.DriverManager');
> //user name and password
> conn = driverManager.getConnection( connURL, 'USER', 'PASSWORD' );
> sql = "update budgets.dbo.budgetids set CC = ? where budgetid like ?";
> ps = conn.prepareStatement(sql);
> ps.setString(1,'400');
> ps.setString(2,'B007%');
> n = ps.executeUpdate();
> </cfscript>
> <cfoutput>
> Records Affected: #n#
> </cfoutput>
>
> Notice that I had to give a fully qualified path to the table in my SQL
> statement.
>
> > -----Original Message-----
> > From: Qasim Rasheed [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 20, 2006 12:06 PM
> >
> > 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>
>
>
> [INFO] -- Access Manager:
> 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.   A2
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238377
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to