Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Connecting to SQL WITHOUT DNS

Posted on 2008-10-20
7
Medium Priority
?
288 Views
Last Modified: 2013-12-24
In PHP, ASP, .NET you can connect to a database without the use of DNS entries.  I would like to do the same for a SQL database with ColdFusion.  Does anyone know what the code lines are for something like this.  My goal is to not have to use any DNS entries, so it is completely standalone and can move from server to server without any setup of DNS.
0
Comment
Question by:mopar003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 63

Expert Comment

by:Zvonko
ID: 22762515
0
 
LVL 1

Author Comment

by:mopar003
ID: 22762689
This seems to be the idea of what I am looking for, but usig the examples, I can not get it to work correctly.  Keep coming up with an error

Cannot find CFML template for custom tag query.  
ColdFusion attempted looking in the tree of installed custom tags but did not find a custom tag with this name.  
 
The error occurred in Y:\default\main\ts.internet\checksutterfirst.org\checksutterfirst.org_Live\WORKAREA\checksutterfirst.org\sslforms\designRequest\index.cfm: line 17
 
15 : <cfset dSourceService = factory.dataSourceService />
16 : <cfdump var="#dSourceService.getDrivers()#" />
17 : <cf_query jdbcURL="jdbc:macromedia:sqlserver://XXXXXXX.ORG;databaseName=DesignRequest">
18 : select *
19 : from DesignRequest
20 : </cf_query>

The CFDUMP shows the info, but connecting is still a no go
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 22762702
The upper custom tag sounded good but I did not got it working.
Perhaps this way works for you: http://www.driverweb.com/dsn-less-connection.htm
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 63

Expert Comment

by:Zvonko
ID: 22762717
The query.cfm for that <cf_query> tag is found in the Download zip file.
0
 
LVL 1

Author Comment

by:mopar003
ID: 22762725
That is what I currently use for Access database files, but that doesn't work for SQL Servers.
0
 
LVL 36

Accepted Solution

by:
SidFishes earned 2000 total points
ID: 22762822
how about this

<cfscript>
classLoad = createObject(java, java.lang.Class);
classLoad.forName(sun.jdbc.odbc.JdbcOdbcDriver);
dm = createObject(java,java.sql.DriverManager);
conn = dm.getConnection(jdbc:odbc:DRIVER={SQL Server};Database=DBNAME;Server=SERVER NAME OR IP;, LOGIN, PASSWORD);
st = conn.createStatement();
rs = st.ExecuteQuery(SELECT * FROM myTable);
qry = createObject(java, coldfusion.sql.QueryTable).init(rs);
</cfscript>

http://www.fusionteam.co.uk/blog/2008/02/27/coldfusion-dsnless-connection-to-a-database/
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 22762833
check the link as ee seems to have stripped the ""
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question