18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Prerequisite to connect to SQLsrvr 2008 DB, class not found error rcvd

santosh.kandesantosh.kande Members
edited December 2012 in Sahi - Open Source
Hi ,

I am trying to connect to SQLSERVER DB with below connection String , when tried to execute script
recieved Class Not found error.

_getDB("com.microsoft.sqlserver.jdbc.SQLServerDriver",Database Name,Uname,pwd);

Please let me the details , how to pull values from DB. From Scratch..

Thanks in Advance..

Santosh.

Answers

  • hi

    you may have to start sahi with the classpath set to the jdbc. From command line it would be like
    export SAHI_EXT_CLASS_PATH=$locationOfFile
    sh sahi.sh
    
    in Unix. For windows the commands may alter.
    If you are sure, you set the classpath, try
    var file = new File($location)
    // check exists and readable with
    file.exists();
    file.isReadable();
    
    Please check these things.

    http://sahi.co.in/w/_getdb looks promising, do you need more information?

    Regards
    Wormi
  • santosh.kandesantosh.kande Members
    edited April 2012
    Thanks for the response but it doesn't work,
    I have added the both sqljdbc.jar and sqljdbc4.jar in sahi\extlib\db folder. and changed the SAHI_EXT_CLASS_PATH=$locationOfFile in start sahi dashboard.bat.

    Please let me know the solution for this.

    Do we need to create any DSN or adding jar files to jdk or any other required things to be done?
  • Well.. I just had problems when not pointing directly to the jdbc. If the classpath is set to the file containing the SQLServerDriver I see no reason why you shoudl get a Class Not found error.

    I hope somebody else can help you.
  • Please can any body let me know the set up and procedure to connect to SQL SERVER 2008 Database..
    and required jar files and where to be placed..
Sign In or Register to comment.