Connect to SQL server 2005 in web dynpro java

10-11  Source: Network gathering  Views:2 

I am new to web dynpro. I want to coonect to SQL server 2005 server from my simple application.
For that what and all the prerequisetion and what and all the steps to follow.
I have created a database and the table too. I have created the application too. But i am not able to connect to sql. what might be the problem. I tried to create the data source in visual administration. and written code in the view like this.
try {
                                               String userName = "jktuser";
               String password = "jkt12345";
               String url ="jdbc:microsoft:sqlserver://jktr3:50000;database=student";
               Class.forName(" ").newInstance();
               Connection con =DriverManager.getConnection(url, userName, password);
               System.out.println("Database connection established");
               Statement st = con.createStatement();
               String str = "select * from studentdata";
               ResultSet rs = st.executeQuery(str);
               while ( {
               String str1 = rs.getString(1);
                                                String str2 = rs.getString(2);
          } catch (Exception e) {
And i am getting this error
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]End of stream was detected on a read.
Plz any one help me in this.
Edited by: H.V Swathi on Nov 21, 2008 6:46 AM
Edited by: H.V Swathi on Nov 21, 2008 7:16 AM
Edited by: H.V Swathi on Nov 21, 2008 7:17 AM
I have tried all the steps to configure the remote connection but it is giving an error that says,
"Computer localhost does not exist on the network, or the computer cannot be configured remotely. Verify that the remote computer has the required Windows Management Instrumentation components and then try again. (SQLSAC)
An exception occurred in SMO while trying to manage a service. (Microsoft.SqlServer.Smo)
For help, click:
Failed to retrieve data for this request. (Microsoft.SqlServer.SmoEnum)
For help, click:
The operation could not be completed. (WinMgmt)
Please i welcome your valuable inputs.
Thanks & Regards
Related articles