Access Coldfusion SQL driver directly

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Access Coldfusion SQL driver directly

    Hi

    Anybody know if I can access coldfusion MS SQL driver directly like I can
    access the mysql driver

    eg

    <cfscript>
    clazz = CreateObject("java", "java.lang.Class");
    clazz.forName("org.gjt.mm.mysql.Driver");
    driverManager = CreateObject("java", "java.sql.DriverManager");
    conurl = "jdbc:mysql://server/db?user=u&password=p";
    connection = driverManager.getConnection(conurl);
    </cfscript>

    Thanks



    Aneesha Guest

  2. Similar Questions and Discussions

    1. coldfusion JDBC driver setting
      I have coldfusionmx 7 installed on red hat linux enterprise 4 . How can i change the coldfusion JDBC driver to oracle 10g JDBC driver, that's may...
    2. oracle thin driver/coldfusion mx 7
      I'm running mx 7 on sun solaris 5.8. how do I configure mx 7 to connect to an oracle thin driver
    3. MS Access Driver for MAC or alternatives
      Hello all, Have installed CF 7 on my MAC running OSX. Everything is fine except for it does not show an MS Access Driver in the dropdown list...
    4. Need Microsoft Access DB driver for Mac OS
      Is there a driver I can install or what can I put in instead of the Microsoft Access driver when setting up a DSN on my mac version of Coldfusion? ...
    5. ColdFusion 5/Oracle 10g Native Driver
      We are upgrading from Oracle 8.1 to Oracle 10g. We are using ColdFusion 5 Enterprise Edition. When setting up data sources using native drivers,...
  3. #2

    Default Re: Access Coldfusion SQL driver directly

    I believe you can.
    mxstu Guest

  4. #3

    Default Re: Access Coldfusion SQL driver directly

    Would you happen to know what the clazz.forName is?

    Thanks
    Aneesha Guest

  5. #4

    Default Re: Access Coldfusion SQL driver directly

    It depends on which one you're using. I've used both the macromedia driver and
    the ms driver. Sorry for all the extra text.. I was too lazy to cut out the
    class names ;-)

    getPageContext().getClass().forName("macromedia.jd bc.MacromediaDriver");

    getPageContext().getClass().forName("com.microsoft .jdbc.sqlserver.SQLServerDrive
    r");


    mxstu Guest

  6. #5

    Default Re: Access Coldfusion SQL driver directly

    Thank you very much.

    I'm trying to experiment with batch updates:
    [url]https://www6.software.ibm.com/developerworks/education/x-insert/x-insert-8-1.html[/url]
    Aneesha Guest

  7. #6

    Default Re: Access Coldfusion SQL driver directly

    Do you have to register to access that link?
    mxstu Guest

  8. #7

    Default Re: Access Coldfusion SQL driver directly

    Yes -- you have to register to access a few things on that site.

    This is what I'm doing:

    class = createObject("java", "java.lang.Class");
    class.forName("macromedia.jdbc.sqlserver.SQLServer Driver");
    dm = createObject("java","java.sql.DriverManager");

    con =
    dm.getConnection("jdbc:macromedia:sqlserver://sqlserver;databaseName=dbname","us
    ername","password");
    st = con.createStatement();

    st.addBatch(sql1);
    st.addBatch(sql2);
    st.addBatch(sql3);

    st.executeBatch();
    st.close();
    con.close();

    Aneesha Guest

  9. #8

    Default Re: Access Coldfusion SQL driver directly

    Okay. I would be curious to see if there is any difference in performance
    between your code and a CFQUERY update using CFQUERYPARAM, which is supposed to
    provide enhanced performance when executing the same statement w/parameters
    multiple times.

    mxstu Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139