on 11-14-2006 7:47 AM
Hi
I am facing a problem with database connection. I am trying to develop a normal webdynpro application.
I want to retrieve data from a table and show it.
But my query is not giving the expected output. It is not even raising errors.
Please give me an answer
Thanks & regards
Aparnna
Thank u
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go through the following
http://help.sap.com/saphelp_nw04/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Connection con=null;
Statement st=null;
ResultSet rs=null;
public void wdDoInit()
{
//@@begin wdDoInit()
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:erdsn","root","enteg123");
st=con.createStatement();
}
catch(Exception e){
}
//@@end
}
public void onActiononClickLogin(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiononClickLogin(ServerEvent)
String desig=null;
try{
rs = st.executeQuery("select * from Login where Empid like uid and Pword like pw");
if(rs.next()){
desig=rs.getString("Designation");
wdComponentAPI.getComponent().getMessageManager().reportSuccess(desig);
if(desig.equalsIgnoreCase("Employee")){
wdThis.wdFirePlugEmpOutPlug();
}
else
{
wdComponentAPI.getComponent().getMessageManager().reportWarning("Invalid input!");
}
}catch(Exception e){
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aparna,
Please post code so that we can see what went wrong.
try following
try{
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/<<DatasourceName in VisualAdmin>>");
con = ds.getConnection();
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from TABLENAME");
}
catch(Exception e){}
You need to configure Datasource in the visualadminstrator ->services->jdbc
Regards, Anilkumar
Message was edited by:
Anilkumar Vippagunta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.