| Author | 
		  Message
		 | 
		
		  | voyager | 
		  
		    
			  
				 Posted: Fri Mar 16, 2007 5:51 am    Post subject: JDBC ODA | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 28 Dec 2004 Posts: 127
  
  | 
		  
		    
			  
				All,
 
Thank you all for your assistance on the previous posts.
 
Previously, I have used Data Direct JDBC drivers provided by IBM to connect to 
 
SQL Server database and for JDBC ODA. I wanted to switch to Microsoft JDBC driver now. 
 
So, I have downloaded MS JDBC driver from 
 
http://www.microsoft.com/downloads/details.aspx?FamilyID=07287b11-0502-461a-b138-2aa54bfdc03a&DisplayLang=en
 
 
I copied mssqlserver.jar, msbase.jar and msutil.jar to CROSSWORLDS\lib   folder. 
 
By the way, this is on a Windows 2003 OS. I tried to connect to SQL server 2000 DB  
 
by configuring JDBC ODA with the following info:
 
UserName: xxxx
 
Password: zzzzz
 
DatabaseURL: jdbc:microsoft:sqlserver://<DatabaseServerName>:1433;DatabaseName=XXXXX;SelectMethod=cursor;
 
 
DatabaseDriver: com.microsoft.jdbc.sqlserver.SQLServerDriver 
 
I get the following error:
 
 
Error in call core.SetAgentProperties: Unable to establish connection to Database. The specified driver class 
   
	| Quote: | 
   
  
	| com.microsoft.jdbc.sqlserver.SQLServerDriver | 
   
 
 could not be found.
 
 
Obviously, it is not classpath problem. 
 
 
Here is my start_JDBCODA.bat:
 
REM set AGENTNAME=JDBCODA
 
REM set AGENT="%CROSSWORLDS%"\ODA\JDBC\JDBCOda.jar
 
REM set JCLASSES="%CROSSWORLDS%"\lib\rt.jar;"%CROSSWORLDS%"\lib\vbjorb.jar;"%CROSSWORLDS%"\lib\xwutil.jar;"%CROSSWORLDS%"\lib\xwbase.jar;"%CROSSWORLDS%"\lib\xwsqlserver.jar;"%CROSSWORLDS%"\lib\jt400.jar;"%CROSSWORLDS%"\lib\spy\lib\spy.jar;"%CROSSWORLDS%"\lib\xerces.jar;"%CROSSWORLDS%"\lib\jdom.jar;"%CROSSWORLDS%"\ODA\JDBCODA\JDBCODA.jar;"%CROSSWORLDS%"\lib\CwODK.jar;"%CROSSWORLDS%"\lib\classes12_01.zip;"%CROSSWORLDS%"\lib\CrossWorlds.jar
 
REM set AGENTCLASS=com.crossworlds.oda.jdbcoda.JDBCOda
 
 
 
setlocal
 
REM IF WBIA_RUNTIME is set use ODK Runtime scripts
 
 
if "%WBIA_RUNTIME%"=="" goto CROSSWORLDS
 
REM Invoke the CWODAENV.bat
 
call "%WBIA_RUNTIME%"\bin\CWODAEnv
 
 
goto LAUNCH
 
 
:CROSSWORLDS
 
REM Invoke the CWODAENV.bat
 
call "%CROSSWORLDS%"\bin\CWODAEnv
 
 
:LAUNCH
 
 
set AGENTNAME=JDBCODA
 
set AGENT="%CROSSWORLDS%"\ODA\JDBC\JDBCODA.jar
 
set AGENTCLASS=com.crossworlds.oda.jdbcoda.JDBCOda
 
 
 
REM Modify this Driver path to point to the specific driver you want to use.
 
REM set DRIVERPATH="%CROSSWORLDS%"\lib\xwutil.jar;"%CROSSWORLDS%"\lib\xwbase.jar;"%CROSSWORLDS%"\lib\xwsqlserver.jar;"%CROSSWORLDS%"\lib\jt400.jar;"%CROSSWORLDS%"\lib\xworacle.jar;"%CROSSWORLDS%"\lib\spy\lib\spy.jar
 
REM set DRIVERPATH="%MICROSOFT%"\lib\msutil.jar;"%MICROSOFT%"\lib\msbase.jar;"%MICROSOFT%"\lib\mssqlserver.jar;"%CROSSWORLDS%"\lib\jt400.jar;"%CROSSWORLDS%"\lib\xworacle.jar;"%CROSSWORLDS%"\lib\spy\lib\spy.jar
 
set DRIVERPATH="%CROSSWORLDS%"\lib\msutil.jar;"%CROSSWORLDS%"\lib\msbase.jar;"%CROSSWORLDS%"\lib\mssqlserver.jar;"%CROSSWORLDS%"\lib\jt400.jar;"%CROSSWORLDS%"\lib\xworacle.jar;"%CROSSWORLDS%"\lib\spy\lib\spy.jar
 
 
 
REM Modify DRIVERLIB path to point to the specific driver dll libraries you want to use.
 
REM set DRIVERLIB=C:\Program Files\SQLLIB\bin
 
REM set DRIVERLIB=
 
set DRIVERLIB="%CROSSWORLDS%"\lib
 
 
 
set JCLASSES=%JCLASSES%;%AGENT%;%DRIVERPATH%
 
set JLIBRARIES="%CROSSWORLDS%"\bin;%DRIVERLIB%
 
 
REM Start the Object Discovery Agent
 
%CWJAVA% -Duser.home="%CROSSWORLDS%" -Djava.library.path=%JLIBRARIES% -mx128m %ORB_DEP% -classpath %JCLASSES% com.crossworlds.ODKInfrastructure.%CONNECTION% -l%AGENTNAME% -c%AGENTCLASS% 
 
 
endlocal
 
pause
 
 
I appreciate your help to resolve this issue.
 
Thank you all! _________________ voyager | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | vennela | 
		  
		    
			  
				 Posted: Fri Mar 16, 2007 12:21 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India 
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	| Obviously, it is not classpath problem.  | 
   
 
 
Obviously it is CLASSPATH problem | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | voyager | 
		  
		    
			  
				 Posted: Fri Mar 16, 2007 1:20 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 28 Dec 2004 Posts: 127
  
  | 
		  
		    
			  
				It seems to be a classpath problem. But, it is not because I have the driverpath included in my classpath. 
 
Thanks! _________________ voyager | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Michael Dag | 
		  
		    
			  
				 Posted: Fri Mar 16, 2007 1:54 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam) 
  | 
		  
		    
			  
				
   
	| voyager wrote: | 
   
  
	It seems to be a classpath problem. But, it is not because I have the driverpath included in my classpath. 
 
 | 
   
 
 
 
so is it working now? if yes, what was the problem? _________________ Michael
 
 
 
 
 
MQSystems Facebook page | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | voyager | 
		  
		    
			  
				 Posted: Sat Mar 17, 2007 7:09 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 28 Dec 2004 Posts: 127
  
  | 
		  
		    
			  
				It is still not working. I am working on it...
 
Thanks! _________________ voyager | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Il_Ciclone | 
		  
		    
			  
				 Posted: Wed Mar 21, 2007 8:01 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Novice
 
 Joined: 21 Mar 2007 Posts: 24
  
  | 
		  
		    
			  
				I use the "Microsoft SQL Server 2005 JDBC Driver" driver
 
 
pointing out the sqljdbc.jar explicitly in the %DRIVERPATH% in startODA.bat
 
 
my DB URL is: jdbc:sqlserver://<hostname>:<port>;databaseName=<dbname>
 
with JDBC driverclass com.microsoft.sqlserver.jdbc.SQLServerDriver
 
 
noted that you class was not the same. typo? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | voyager | 
		  
		    
			  
				 Posted: Tue Mar 27, 2007 6:48 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 28 Dec 2004 Posts: 127
  
  | 
		  
		    
			  
				This is  for MS SQL Server 2000 and not for MS SQL Server 2005: 
 
jdbc:microsoft:sqlserver://<DatabaseServerName>:1433;DatabaseName=XXXXX;
 
 
 
 
DatabaseDriver: com.microsoft.jdbc.sqlserver.SQLServerDriver 
 
 
For "Microsoft SQL Server 2005 JDBC Driver" driver:
 
 
jdbc:sqlserver://<hostname>:<port>;databaseName=<dbname>
 
with JDBC driverclass com.microsoft.sqlserver.jdbc.SQLServerDriver 
 
 
For some reason, MS has changed the URLs and DatabaseDriver in SQL Server 2005.
 
 
Thanks! _________________ voyager | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | voyager | 
		  
		    
			  
				 Posted: Tue Mar 27, 2007 6:50 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Centurion
 
 Joined: 28 Dec 2004 Posts: 127
  
  | 
		  
		    
			  
				All,
 
Thanks for your valuable comments. This is working now. 
 
I have included the DRIVERPATH in the CLASSPATH.
 
Thank you! _________________ voyager | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |