on 04-23-2007 5:52 PM
Hi Experts
I need some help. I am trying to retrive data from SQLServer. The steps I did are .
In the Visual Administrator ,I have created Data Source 'MSSQL2000SRVR' and added recommanded 3 jar files for SQL2000 .The code is
InitialContext initialContext = new InitialContext();
javax.sql.DataSource dataSource = (DataSource)initialContext.lookup("jdbc/MSSQL2000SRVR");
java.sql.Connection conn = dataSource.getConnection();
I am getting the error bellow
-
SQL Exception ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'sa'.
SQL Exception : No suitable driver
Could any one help me . I promise to reward points to the right solution. I would like to speak if any one is willing to give me their contact number/mail.
Thank you
Regards
Maruti
Hai,
If you are using sql server 200 you need the jars
msbase.jar
mssqlserver.jar
msutil.jar
but if you are using sqlserver 2005.
you need only one jar file
sqljdbc.jar.
Regards,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maruti,
Second error message is totally bogus (no suitable driver).
Looks like your are using incorrect password for user "sa" or such user does not exists in database (probably admin removed this default login for security reasons).
So contact your DB admins to get valid pair of user/password, check it validity with MS SQL Query Analyzer, then change corresponding parameters of JDBC url.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
which 3 drivers have you added, are they of higher version ?
regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maruti,
You need to use the Alias that u have defined for the DataSource and not the DataSource name.
javax.sql.DataSource dataSource = (DataSource)initialContext.lookup("jdbc/<u>MSSQL2000SRVR</u>");
Hope it helps,
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.