cancel
Showing results for 
Search instead for 
Did you mean: 

Reg Web Dynpro with SQL Server

Former Member
0 Kudos

Hi All,

We need to build a Web Dynpro application which should interact with SQL Server. We are working on EP 7.0. The current User Database is SQL Server.

For the new Web Dynpro application can we create new Table in the same SQL Server database.

Also, can someone provide some tutorial on how to connect to SQL Server from Web Dynpro.

Regards

Nikhil Bansal

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member206397
Contributor
0 Kudos

Hi,

You can use the following code to access data from Web Dynpro. One more thing you need to create data source.

try{

Context contxt = new InitialContext();

DataSource datasrc = (DataSource) contxt.lookup("jdbc/<name of the data source>");

Connection connection = datasrc.getConnection();

Statement stmt = connection.createStatement();

ResultSet resultset = stmt.executeQuery("SELECT * FROM <Table Name>");

while(resultset.next())

{

String str1 = resultset.getString(1);

..

....

....

}

}

catch(Exception ex1){

<error report>

}

praveenkumar_kadi
Active Contributor
0 Kudos

Hi,

You can also look at

hope that helps

Former Member
0 Kudos

Nihil,

Check the blog for connecting to SQL server.

/people/anilkumar.vippagunta2/blog/2007/02/20/reading-and-writing-images-from-sqlserver-in-webdynpro

Regards,Anilkumar

Former Member
0 Kudos

Nihil,

Check the blog for connecting to SQL server.

/people/anilkumar.vippagunta2/blog/2007/02/20/reading-and-writing-images-from-sqlserver-in-webdynpro

Regards,Anilkumar