Setting a ColdFusion DSN

I know the HSphere ColdFusion DSN creation was buggy, so we have to have tech support do it for us.

Can you give me an idea of what information is needed when I need to request a ColdFusion DSN connection for one of my clients?

By sending in a ticket, do you already know what my account is? Do I just give the DSN I have created through, say, the MySQL wizard? What about for Access DBs, MSSQL, etc.?

If I know exactly what I need to ask the tech to do, and provide the proper info, I would think things could be accomplished more efficiently!

-Gary
 
We need, DSN name, server name or IP, database name, login name, and passwords.

Also, you can run DSNless connections:

MySQL:


<cfscript>
class = createObject("java", "java.lang.Class");
class.forName("org.gjt.mm.mysql.Driver");
dm = createObject("java","java.sql.DriverManager");
con = dm.getConnection("jdbc:mysql://111.111.111.111:3306","user","password");
st = con.createStatement();
resultSet = st.executeQuery("SELECT * from xy where zx = '#arguments.email#'");
cfquery = CreateObject("java", "coldfusion.sql.QueryTable").init(resultSet);
resultSet.close();
st.close();
con.close();
</cfscript>

MSSQL:


<cfscript>
class = createObject("java", "java.lang.Class");
class.forName("macromedia.jdbc.sqlserver.SQLServerDriver");
dm = createObject("java","java.sql.DriverManager");
con = dm.getConnection("jdbc:macromedia:sqlserver://111.111.111.111:1433;databaseName=name_ofdb","user","pass");
st = con.createStatement();
resultSet = st.executeQuery("SELECT * from xy where zx = '#arguments.email#'");
cfquery = CreateObject("java", "coldfusion.sql.QueryTable").init(resultSet);
resultSet.close();
st.close();
con.close();
</cfscript>



This is from Dan Plesse, you can find more examples on one of his sites:
http://www.geocities.com/empiricallyspeaking/DSN-LessConnection.html
 
Stephen said:
We need, DSN name, server name or IP, database name, login name, and passwords.

Also, you can run DSNless connections...

Yeah but one missing close will result in a nightmare on the server. Let's not suggest that most folks use DSNLess.
 
Well I found out one user at quota will cause major problems too if they use an access db :)
 
Back
Top