cancel
Showing results for 
Search instead for 
Did you mean: 

Connect WDJ to Sql server 2005

Former Member
0 Kudos

Dear Experts,

I need to connect, SQL server 2005 unsing WD java, can any one tell me what steps i need to do on WDJ side to established the connection.

Also the what all jar files required to connect SQL 2005.

Thank

AB

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

what's the version of your nw java server?

if you are in nw7, you have to create a datasource in VA

if you are in CE, you have to create a datasource in NWA.

after the data source is created, the left is pure java programming.

try {
InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource)initialContext.lookup("jdbc/YOUR_DB_ALIAS");
connection= dataSource.getConnection();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

former_member192434
Active Contributor
0 Kudos

Thanks John for prompt reply,

is that any jar file also required, if yes then where i can put/configure jar files. ....

Or just above code will do the need full.

Thanks

AB

junwu
Active Contributor
0 Kudos

have you done any java jdbc programming?

you should know what jar you need.

it is pure java, nothing to do with sap.

when you create the data source, you will upload the driver to server.

WDJ side has nothing to configure.

Former Member
0 Kudos

Hi Anup,

While creating the datasource you'll have to upload the driver. that is sqljdbc.jar.

You can also keep this jar in lib dc.

Regards

Deepak

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Anup,

If you are using NWDS 7.0 version, you have to create a Datasource in visual admin.

If you are using CE 7.1 version, you have to create a Datasource in NWA--Configuration Management->Infrastructure->Application Resources.

Step by step procedure how to create a Datasource in NWDS 7.0 and CE7.1 is given in this PDF link.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40db1ed9-b7c2-2b10-66b8-84f6954b6...

MYSQL Server 2005

Driver/jar which you have to use --> sqljdbc.jar

Driver class --> com.microsoft.sqlserver.jdbc.SQLServerDriver

Connection URL --> jdbc:sqlserver://<host_name>:<port>;database=<db_name>

Hope this helps you..

Regards,

Saleem Mohammad

Former Member
0 Kudos

This message was moderated.