on 03-30-2005 2:05 PM
Dear all ,
I did the necessary steps required for data base access in Visual Administrator(JDBC Connection)--> Both Driver and DataSource for MSSQL.
Created the Alias name .. Example -- MSSQL.
then ,, coded like this in portal application,
******************
InitialContext ctx = new InitialContext();
DataSource src = (DataSource) ctx.lookup("jdbc/MSSQL");
Connection con = src.getConnection();
***************
here the connection is successful..
But after this
**************************
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from employee");
while (rs.next()) {
response.write(rs.getString(1));
}
*************
i am getting an exception like this ..below...
************************
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'BC_DDDBTABLERT'
*********
can anyone help me...
to resolve this problemm..
with regards..
Kishor.G
Hi there
can u tell me how u solve this prob??
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I have MSSQL Server too,
InitialContext ctx = new InitialContext();
DataSource src = (DataSource) ctx.lookup("jdbc/MSSQL");
this works but when I try to do the Connection,
Connection con = src.getConnection();
I become this Exception:
com.sap.engine.services.dbpool.exceptions.BaseSQLException: 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]Unable to connect. DataSource property serverName must be specified.
Can anybody help me?
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I solved the problem:
You have to go in the VisAdmin-JDBC Connection-Runtime-"mark Your DB Connection"-Additional-"mark SQL Engine Native SQL"
Cheers
Walter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I'm facing the same problem - did You solved it? If Yes, PLEASE let me know how...
Greetings Walter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had a similar issue with jdbc. My guess is that MSSQL handles tables and attributes with case sensitivity. When I tried a select statement with table name in lower case it failed, but when I tried it in Uppercase, it worked fine. Guess I might have created the tables in Uppercase in SQL server. See if it helps!
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
is the tablename correct ? should you use sapr3.employee ?
i am not sure how it works on MSSQL.
also we generally do a rs.movefirst before the while loop.
Regards,
Siddhesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishor,
are your sure you have got the connection properly? I think instead of writing the following look up
DataSource src = (DataSource) ctx.lookup("jdbc/MSSQL");
you should look it up like
DataSource src = (DataSource) ctx.lookup("java:env/jdbc/MSSQL");
just try this and let us know.
Regards,
SG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You mention you setup the JDBC connecton in the VA, did the test execute work correctly in the VA?
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.