on 06-29-2011 9:25 AM
Hey,
I'm having some troubles to connect to MaxDB using Java. I'm getting some error when I try to run my program.
import java.sql.*;
public class Hello
{
public static void main(String[] args)
throws ClassNotFoundException, SQLException
{
String username = "DBM";
String password = "azerty";
String dbname = "SAPDB";
Class.forName ("com.sap.dbtech.jdbc.DriverSapDB");
Connection connection = DriverManager.getConnection("jdbc:sapdb:" + dbname, username, password);
...
}
}
Exception in thread "main" com.sap.dbtech.jdbc.exceptions.DatabaseException: [-4008]: Unknown user name/password combination
at com.sap.dbtech.jdbc.packet.ReplyPacket.createException(ReplyPacket.java:69)
at com.sap.dbtech.jdbc.ConnectionSapDB.throwSQLError(ConnectionSapDB.java:768)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:434)
at com.sap.dbtech.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:325)
at com.sap.dbtech.jdbc.ConnectionSapDB.doConnect(ConnectionSapDB.java:277)
at com.sap.dbtech.jdbc.ConnectionSapDB.<init>(ConnectionSapDB.java:81)
at com.sap.dbtech.jdbc.DriverSapDB.connect(DriverSapDB.java:184)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
I checked the User and Password with the GUI (Database manager) and everything works fine.
I've also added the .jar in my Project Library.
Any ideas ?
Thanks
Did you try logging in to the SQL GUI using the credentials provided here? If you can log in to DBMGUI with this user account, chances are it's a DBM operator user account which is not allowed to do SQL. Those also aren't allowed to connect via JDBC IIRC. Have a look at [http://wiki.sdn.sap.com/wiki/display/MaxDB/UserConcept|http://wiki.sdn.sap.com/wiki/display/MaxDB/UserConcept] for more.
Good luck,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try the SQL Studio with these user credentials? Also, how did you create the database instance you are using? And, as far as this other problem is concerned, what operating system / machine you are on? Generally, if there aren't any compatibility objections, I don't think going with the most up-to-date MaxDB version is a bad thing, but it won't eventually solve your problems regarding user credentials.
Cheers,
Kristian
I am not sure about this. I see ([ [original link is broken]| [original link is broken]]) that MaxDB obviously "just" supports server variants of MS Windows systems, yet I know that MaxDB (a) does run well on Windows XP Professional (32bit) and (b) so far did not correctly install / run on our Windows 7 testbed (MaxDB 7.7, 64bit). This doesn't really hurt us much as most of our machines run some Linux variant anyway and we never had any trouble with MaxDB in there.
However, I am not sure whether this really relates to your problem. Apart from the Database Studio, did MaxDB itself install well? Did you try removing all the stuff, installing MaxDB anew, and installing DBMGUI/DBMCLI all along with it, then? Also, which users did you create all along with creating your database instance in MaxDB?
Cheers,
Kristian
I solved the problem now.
I've uninstalled everything, and installed the last version (I think the version doesn't matter). Added the sapdbc.jar to my Project Library and finaly logged with DBADMIN.
Now how can I manage my database, I know that it is possible using Database Studio, but it's not working with me.
This the problem I'm getting when I log using dbmcli : http://img4.imageshack.us/img4/521/maxdb.png
Looking at your screen shot, it seems the database instance itself hasn't been correctly created because you lack permissions to do so. Subsequently, all your connection attempts basically fail because the database does not exists. I'm no real expert in SAP MaxDB administration on Microsoft Windows, but I read about System Error 5 once in a while earlier, have a look at [http://www.syseva.com/2009/05/operating-system-error-5-5access-is-denied/|http://www.syseva.com/2009/05/operating-system-error-5-5access-is-denied/]. Overally, I suspect you don't have the permissions you need to have (operating system/file system -wise) in order to create the files belonging to a MaxDB instance (and/or required by the server and tools, such as the dbmsrv ... err file mentioned in the screen). Maybe you should check your system permissions? Are you administrator or member of the appropriate groups [http://maxdb.sap.com/doc/7_7/0e/218650d996419d91f6b234766eadd3/content.htm|http://maxdb.sap.com/doc/7_7/0e/218650d996419d91f6b234766eadd3/content.htm]? As pointed out, I'm no MaxDB/Windows expert, but this seems likely to be a problem as far as your screenshot is concerned.
Cheers,
Kristian
Thank you very much Kristian, after your System error 5 advice, I googled the word and found a topic about it.
So. To run the dbmcli commands you should run the Command Prompt as administrator and type into it :
"C:\Program Files\sdb\globalprograms\bin\sdbshell.cmd" -i "DBMax"
Now you have all the rights to do whatever you want.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.