Connecting Data Virtuality Server from Python using JDBC Driver and JayDeBeApi

Follow

Comments

2 comments

  • Avatar
    Anupam Chaubey

    its not working i  am getting jpype.PyJPField' object has no attribute 'getStaticAttribute error 

     

    can some please tell me the solution 

    0
    Comment actions Permalink
  • Avatar
    Peter Sykes

    If JDBC is not working for you, use ODBC. Probably a version issue.
    Here is something out of a jupyter notebook, but it should work. A DSN can be used instead also.

    import pyodbc
    usr = 'YourUser' # usr name
    passwd = 'YourPassword' # the password for the user
    connString_B= "driver={DataVirtuality Unicode(x64)}; server=YourServer; port=35433; database=datavirtuality; sslmode=require; uid="+usr+"; pwd="+passwd+";";

    cnxn_B = pyodbc.connect(connString_B)
    cursor_B = cnxn_B.cursor()
    SQLCommand_B = ("select 1")
    cursor_B.execute(SQLCommand_B)
    row_B = cursor_B.fetchall()
    print (row_B)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk