web stats
Help connecting to SQL Server 2005 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2009, 08:53 AM
PKenton PKenton is offline
What's HL7?
 
Join Date: Mar 2009
Posts: 3
PKenton is on a distinguished road
Post Help connecting to SQL Server 2005

I have started looking at Mirth and I am trying to create a very simple channel to pull data out of a SQL Server database and create a flat file. I am trying to connect the default intstance of SQL Server installed on the same machine as Mirth. I am getting the following error:

I downloaded the JDBC driver for SQL Server and set the classpath in my control panel environment variable to the location of the JDBC jar file but I am not having any success. I have been reading post and searches and see that others are using JDBC for SQL Server so I know it works.

Wrapped java.sql.SQLException: No suitable driver found for dbc:sqlserver://localhost:1433;databaseName=AdventureWorks;integra tedSecurity=true; (6339ebee-00f7-4686-ba50-b674699847e4#2)



Thanks I appreciate any help
Reply With Quote
  #2  
Old 03-23-2009, 09:59 AM
geraldb geraldb is offline
Mirth Employee
 
Join Date: Aug 2006
Location: Irvine, CA
Posts: 314
geraldb is an unknown quantity at this point
Default

If you go into either the Database Reader or Database Writer panel, the Driver drop-down has a "SQL Server/Sybase" option that will let you connect to SQL Server 2005.

To use a custom driver, first place the jar file in the %MIRTH_HOME%/lib/custom folder. Then, edit the %MIRTH_HOME%/conf/custom/dbdrivers.xml file and add a new entry for your driver. You must specify the class name for the driver, and the display name that will appear in the drop-down. Restart the Mirth server and you should see the new driver in the Database Reader & Writer panels.
__________________
Gerald Bortis | Chief Information Officer | Mirth Corporation
Reply With Quote
  #3  
Old 03-24-2009, 04:47 AM
PKenton PKenton is offline
What's HL7?
 
Join Date: Mar 2009
Posts: 3
PKenton is on a distinguished road
Default

geraldb,

Thanks for your quick reply. I have my channel set up that way. I even installed the latest JRE 6 update 12. I feel like Mirth cannot find my JDBC driver, but I am not sure how to determine for sure. I do not have Java JDK installed because I did not think I need to plus I am not a Java developer so any suggestions you have will be much appreciated.

My Channle Setup:

Connector Type: Database Reader
Driver: SQL Server/Sybase
URL: jdbc:sqlserver://A668H3F1;databaseName=AdventureWorks;integratedSec urity=true
Use Javascript: Yes
Javascript code:
var dbConn = DatabaseConnectionFactory.createDatabaseConnection ('net.sourceforge.jtds.jdbc.Driver','dbc:sqlserver ://localhost:1433;databaseName=AdventureWorks;integra tedSecurity=true','','');
var result = dbConn.executeCachedQuery("SELECT TOP 10 Title, FirstName, LastName FROM Person.Contact");

dbConn.close();
// You may access this result below with $('column_name')
return result;

Thanks Ponce
Reply With Quote
  #4  
Old 03-24-2009, 05:07 AM
jbartels jbartels is offline
Mirth Guru
 
Join Date: Oct 2006
Posts: 725
jbartels is on a distinguished road
Default

http://jtds.sourceforge.net/faq.html#urlFormat

database name is part of the URL not a property.
__________________
Jon Bartels

Zen is hiring!!!!
http://consultzen.com/careers/
Talented healthcare IT professionals wanted. Engineers to sales to management.
Good benefits, great working environment, genuinely interesting work.
Reply With Quote
  #5  
Old 03-24-2009, 08:48 AM
PKenton PKenton is offline
What's HL7?
 
Join Date: Mar 2009
Posts: 3
PKenton is on a distinguished road
Default

Jon,

Thanks for that information. That fixed my problem. One thing I had to change was I could not connect to SQL with integrated security because it said the following message so I switched it to log in with a sql user and password.

Here is the error message:

java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded.

I assume it cannot find the Windows authentication file.
Reply With Quote
Reply

Tags
jdbc, sql server

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:41 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation