|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trouble with dsn less conection
Well I'm new at this DSN Less connection thing with coldfusion Mx I can get it to work when I use it in a static sense Like a static SQL statment but I want to use it with conditional logic. This is just the latest way I've tried to do it, and it doesn't work. I've also tried to run the st.exectute query directly on the SQL logic but it doesn't like the conditional logic and won't work. I'm a newbie at this part of Coldfusion and would apprectiate any help you can give me Thanks.
Latest attempt <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://12.000.000.000:3306/Database","xxxxx","0000000"); st = con.createStatement(); </cfscript> <cfquery name="getcalloutcomeoptions" datasource="con"> Select * From calloutcome where SurveyID = <cfqueryparam value="#SurveyID#" cfsqltype="cf_sql_integer"> <cfif SpawnQuestion is "False"> and WhenToShow ="ALL" </cfif> <cfif SpawnQuestion is "End"> and WhenToShow ="End" </cfif> <cfif spawnQuestion is "True"> and WhenToShow <>"End" </cfif> </cfquery> This way works in a seperate query but doesn't suit my needs in constructing dynamic sql statements <cfset UpdateCallBack = st.executeQuery("UPDATE survey SET CallBackDay='#Day#', CallBackStartTime='#BeginTime#', CallBackEndTime='#EndTime#', Name='#Name#' WHERE ID = #ID#")> |
|
#2
|
|||
|
|||
|
I've never used DSN-less connections in CFMX, so my advice would be save yourself a ton of pain and just create a datasource.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
Well, I would do that. But my hosting company has limits on the amount of database space they give me. So if I can figure this out. I can run the database from a different server.They don't offer a mechanism for setting up a database external to there hosted databases. if I can't figure out a way of doing it I guess I'll just have to pay them more for database storage.
|
|
#4
|
|||
|
|||
|
Well for one, what you're doing is, I'm sure, totally violating any agreements that you approved when you signed up for hosting. Second, if I understand you correctly, then you want to try and connect your CFMX applications at one host to a MySQL database running at some other host or at your home. The performance for this datasource will be absolutely terrible due to the number of hops between the host and the other database server. And third, given how difficult it's going to be to hack around this I'd have to think that paying for some more space or trimming what you already have down to make more room would be way, way easier! Good luck.
![]() |
|
#5
|
|||
|
|||
|
I know you're probably right. But the geek in me wants to figure it out.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Trouble with dsn less conection |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|