1

I am trying to connect to D3 Database with MVSP java api. So far:

  1. I have downloaded the mvapi.jar
  2. added it in project lib folder
  3. written the sample code for connection inside main method

    String url = "jdbc:mv:d3:hostname:portNo";
    Properties props = new Properties();
    props.setProperty("username", "");
    props.setProperty("password", "");
    
    String account = "AGCO";        
    String password = "";
    
    MVConnection connection = null;
    
    try {
    
       // Getting error at this point           
       connection = new MVConnection(url,props);
    
       MVStatement mvStatement = connection.createStatement();
       connection.logTo(account,password);
       MVResultSet results = mvStatement.executeQuery(query);
    }
    

com.tigr.mvapi.exceptions.MVException: server error with errorCode 1023.

I checked the console but I'm not able to figure out the actual cause or whether I am entering the wrong username, password.

Please suggest what I am doing wrong.

Glenn Sallis
  • 415
  • 3
  • 11

1 Answers1

2

First, you have to set a breakpoint or trace which function is throwing the errors. Then check the routes, (FileName) probably you will have much more experience than I do, but keep in mind that giving the full route ("account,filename," where the last comma is important) is never a bad idea while keep you safer and is mandatory if the filename is in a different account that you are logged to.

And like always please verify these things:

  • You have enough licenses. Try to close any terminal you have opened for testing your queries. Yes you know is true. One connection one license. Sometimes MVSP let you two under the same IP but chek this.
  • MVSP service is running. See Pick D3 documentation.
  • Your USER and ACCOUNT are both ENABLED to access in the MVSP server otherwise you won't be able to access these files or login with the user through the API. See the documentation to enable in the MVSP.Menu account.

I hope this helps.

Juanjo
  • 670
  • 7
  • 17