Read MYSQL with WebDynpro

Hello Experts,
i want to read data from a mySQL Database with WebDynpro. If i write a java programm to do this it works perfectly, but if I use this Java code in my WebDynpro Application it doesn't work.
So how can I run this code in my WebDynpro-project:
String Query = null;
java.sql.Connection con = null;
java.sql.Statement stmt = null;
ResultSet rs = null;
try {
Class.forName("com.mysql.jdbc.Driver");
catch (ClassNotFoundException e) {
e.printStackTrace();
System.exit(1);
System.out.println(time.toString());
System.out.println(time);
try {
con =
DriverManager.getConnection(
"jdbc:mysql://server.com",
"user",
"password");
stmt = con.createStatement();
rs = stmt.executeQuery("USE database");
rs = stmt.executeQuery("SELECT * FROM table");
while (rs.next()) {
System.out.print(rs.getString(6));
System.out.print(" --- " + rs.getString(7));
System.out.print(" --- " + rs.getString(8));
System.out.println(" --- " + rs.getString(9));
con.close();
rs.close();
stmt.close();
catch (SQLException e5) {
e5.printStackTrace();
Thanks!

HI johannes,
            Web dynpro application should follow some coding rules,
The following lines are not accepted by web dynpro
you first go through the web dynpro documentaions
e.printStackTrace();
System.exit(1);
System.out.println(time.toString());
System.out.println(time);
System.out.print(rs.getString(6));
System.out.print(" --- " + rs.getString(7));
System.out.print(" --- " + rs.getString(8));
System.out.println(" --- " + rs.getString(9));
e5.printStackTrace();
in webdynpro replace following
system.out.println()----
>wdComponentAPI.getMessageManager().reportSuccess()
To start with WD Java, the following tutorial wil be helpfiul
http://help.sap.com/saphelp_nw04/helpdata/en/f8/bdfe80d9a3b048a5fb32a7d149774e/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#20
To know about Web Dynpro UI Element Reference Guide
http://help.sap.com/saphelp_nw04/helpdata/en/5c/1b76bc3da0504e8b535cf3e154eaa7/frameset.htm
please go to following url,
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#20
there is lot of basic tutorials is there. please go throught it
Refer these links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web%20dynpro%20tutorial%20and%20sample%20applications.faq
What is Web Dynpro? What is Web Dynpro?
Why WebDynpro ? Why WebDynpro ?
Why  webdynpro and not BSP or JSP? Why webdynpro and not BSP or JSP?
BSP to WEB Dynpro BSP to WEB Dynpro
Benifits of using Webdynpro Benifits of using Webdynpro
Java vs. ABAP WEbDynpro Java vs. WebDynpro ABAP
regarding Java related webdynpro regarding Java related webdynpro
Web Dynpro vs. Struts - a few questions Web Dynpro vs. Struts - a few questions
What kind of applications are being developed with Web Dynpro? What kind of applications are being developed with Web Dynpro?
Check this:
http://www.sappro.com/downloads/OptionComparison.pdf
Refer these links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web%20dynpro%20tutorial%20and%20sample%20applications.faq
What is Web Dynpro?
Why WebDynpro ?
Why  webdynpro and not BSP or JSP?
BSP to WEB Dynpro
Benifits of using Webdynpro
Java vs. ABAP
regarding Java related webdynpro regarding Java related webdynpro
Web Dynpro vs. Struts - a few questions
What kind of applications are being developed with Web Dynpro?
Regards,
P.Manivannan

Similar Messages

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • Step for Publish a development created with Webdynpro for Java

    Good Afternoon.
    I am new in this of publish development in the portal.
    We created a development with Webdynpro java using RFC. We want know what are the step for publish this development in the portal ESS?
    The development work fine. But i don't know how to publish this in the portal.
    What configurations i have that do In the part of ECC and in the part of portal.?.
    Can someone help me?
    Kind Regards-

    Hi,
    When i have that do configurations for the following paths:
    Employee Self-Service>General Settings>Homepage for Self-Services-->Resources
    Employee Self-Service>General Settings>Homepage for Self-Services-->Headers and Area Group Pages
    Employee Self-Service>General Settings>Homepage for Self-Services-->Areas
    Employee Self-Service>General Settings>Homepage for Self-Services-->Subareas
    Employee Self-Service>General Settings>Homepage for Self-Services-->Services.
    Kind Regards,

  • Compatibility of an editor made in javascript with WebDynpro

    Currently we are using a textarea for the content for the text of a chapter in an application. Of course end-users would like to have a rich text editor since the result is stored as PDF file, so since we use MVC and BSPs our first thought was to use the BTF editor but it seems that this editor is not planned to be replaced with an equivalent in WebDynpro.
    So we have found a nice editor called FCKEditor (see http://www.fckeditor.net/) done in JavaScript but with java integration possibilities, it is under LGPL open source license.
    So my question is, would it be compatible with WebDynpro ?

    but they say that you can integrate it with java:
    Installing FCKeditor in a JSP environment is quite easy:
    Unzip the Java Integration Library in a directory named "FCKeditor".
    Unzip the content of the FCKeditor release of your choice inside the "FCKeditor\web" folder.
    Then you have to create in tomcat (or any servlet container) a new context named "FCKeditor" that points to the previously created "FCKeditor\web" folder.
    Point your browser to http://domainName.ext/FCKeditor/_samples/index.jsp for the list of the samples.
    Usage
    Take a look at the test files and in the javadoc API provided in the distribution. Here is a simple example.
    First put this taglib definition at the top of the JSP page:
    <%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>
    Then the tag:
    <FCK:editor
    id="EditorAccessibility"        //Unique name of the editor
        width="80%"                 //Width
        height="120"                //Height
        toolbarSet="Accessibility"  //Toolbar name
    >This is another test. <BR><B>The "Second" row.</B></FCK:editor>
    A more advance example, that show how to use the inner tags to overrides any of the settings specified in the config.js file:
    <FCK:editor id="EditorDefault" basePath="/FCKeditor/"
        styleNames=";Style 1;Style 2; Style 3"
        fontNames=";Arial;Courier New;Times New Roman;Verdana" >
        This is some <B>sample text</B>.
    </FCK:editor>
    Building
    Inside the files there is the source files for the tags (/src) and the ant build file (build.xml).
    The ant build file provides the following tasks:
    all: Clean build and dist directories, then compile
    clean: Delete old build and dist directories
    compile: Compile Java sources
    dist: Create binary distribution
    javadoc: Create Javadoc API documentation
    release: Create Release Distribution
    Plus some Tomcat managing tasks (to make this tasks work you need to copy inside the "web" folder the FCKeditor package):
    install: Create a web application pointing to the build directory
    reload: Recompile and reload the web application
    remove: remove the web application
    To start building the class you first need to modify the "catalina.home" property inside the build.xml, then type "ant dist" to compile, create the javadoc API description and generate the jar library to be copied in the WEB-INF.
    Or more easily, type "ant install" after setting the right username and password for the tomcat manager application.

  • How to fetch data from Mysql with SSL.

    I am using jdk1.5 and mysql 5.0.
    How to fetch data from Mysql with SSL
    I am using url = jdbc:mysql://localhost/database?useSSL=true&requireSSL=true.
    It shows error. how to fetch

    I have created certificate in mysql and checked in mysql.
    mysql>\s
    SSL: Cipher in use is DHE-RSA-AES256-SHA
    but through ssl how to fetch data in java.

  • Java DC not deployed with WebDynPro DC

    Hi,
    I've been testing the DC functionality and I'm trying to create the following:
    1) WebDynPro DC (DCA)
    2) Java DC (DCB)
    DCB has code for reading data from a database table (three classes, one is set as a public part). This code is functioning ok in another WebDynpro project where I've used it as an external jar file located in the lib directory and added to classpath.
    DCA has a small table in the view that I'm filling (or trying to) with data from the database.
    DCB has one java class as a Public Part. DCA has this PP defined in the Used DC's (DC Metadata --> DC definition --> Used DC's). I can see the DCB code fine from the DCA's view (I can use the methods from the class).
    I see no code errors and everything compiles ok. I've built the DCA and DCB separately (Development Component --> Build) before doing the project build and deployment.
    When I deploy, I'm getting java.lang.NoClassDefFoundError for the DCB class (User.class) when the program starts. So it seems that the DCB is not deployed with the DCA. I've tried to look at the properties and java classpath but nothing I've done has helped.
    Purpose is set to compilation, and there is a
    <at-build-time/>
    tag in the .dcdef file.
    Deployment of normal (no DC) Webdynpro projects works fine and the jars in the lib directory are deployed to the server OK.
    Seems like I've tried everything but have found no solution yet. Refreshed every part, re-created everything, re-built, re-deployed etc...
    Shortly: how to get DCB to deploy ?
    Any help is appreciated here
    Kind Regards,
    Jari Pakarinen

    Hi,
    What is the Java DC for then ? If it cannot be used as a part of another DC (deployable unit) then how should it be used ? What is the use if it does not end up at the server with Webdynpro code ?
    The scenario I'm looking for is to include Java classes in a Webdynpro project as a part of the project (not jars done somewhere else, I can do that already) deployed to the server with the Webdynpro.
    Thank you for your help, I'm not blaming you or anything
    Regards,
    Jari

  • How can I read cookies in WebDynPro for Java

    Hi,
    in WebDynPro for Java I found a possibility to to get a "request-object" like the standard "HttpServletRequest-object"
    IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
    IWDRequest request = protocolAdapter.getRequestObject();
    debugEnabled = (request.getParameter("Debug") != null);
    With this request-object I can read request-prameters but I couldn't find a possibility to get cookies from the request.
    There is no method like the "getCookies().method" in the HTTPServletRequest-Interface:-((
    Has anybody an idea, how I can read cookies in WebDynPro for Java ?
    Regards
    Steffen

    Hi,
      This is the latest update I could look for regarding cookies and webdynpro.
    Panic - WebContextAdapter is depracted - no more cookies now?
    Regards,
    Harini S

  • OCI with WebDynpro for ABAP in SRM 5.0

    Hi there,
    Can somebody tell me how the OCI interface has to be controlled in SRM 5.0 when free order forms are made with WebDynpro for Abap ?
    Thanks.

    You have posted your message to the wrong forum. This forum is for SRM eSourcing.

  • Data not visible in table o/p when compiled with webdynpro compiler

    Hi,
    I am using a Z BAPI to retrieve data from backend ECC6 server and show it using a VC application.
    When I compile this VC application using FLASH(FLEX2), the data is shown in the table, whilst if the VC application is compiled using Webdynpro compiler, the data is not shown in the table.
    The No. Of Rows  parameter has been updated with 10.
    Please suggest what can be done so that data is shown when compiled with Webdynpro compiler.
    Regards,
    Ranu

    Hi Ranu,
    WebDynpro Compiler only supports Webservices.
    You can look at the below link to get into full details -
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/limitationsofWeb+Dynpro
    Regards,
    Vipin Vijayan.

  • Storing data in data bag with webdynpro for abap

    Hi,
    It´s possible to store data in data bag with webdynpro for abap?
    The EPCF client data bag API provide methods to store data in a transient data buffer on the client:
                               EPCM.storeClientData(nameSpace, name, value)
    Does webdynpro for abap has an equivalent method?
    Thanks,
    Márcio

    Web Dynpro ABAP can produce a portal event and pass parameters along with the event. These parameters can be read by any event receiver.  However you don't have directly access to the data bag as you describe. Here is a link to the help on the Portal Event API:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/da/f96f4132f15c58e10000000a1550b0/frameset.htm

  • Digital signature with webdynpro abap

    Hello,
    how I can signature a character string digitial with webdynpro ABAP?
    My first beginning is the call function "SSFS_CALL_CONTROL". But this is only for BSP. It is is sensible, that I create a small BSP - Application and I integrate this BSP - Application in Webdynpo ABAP. But How I integrate this BSP in WD4A?
    The other way
    Give it a call function for webdynpros ABAP to signature?
    Thanks
    Maik

    Hi Maik,
    what is to be signed. Your own document ?
    I assume you have https and you want to sign you own content
    and allow the DOWNLOAD or other similar to get doc to customer.
    See the Function group SSFC/SSFZ for access to a certificate.
    See security docu for load certificates on to the server. (Tran SSO_STRUST)
    You can also create credentials if requried.
    See also function group SSFG.
    Here are functions to create envelopes and sign them
    This the main tool.  You sign a document to show proof of originality.
    You place in envelop to encrypt it.
    Then send the result.
    See function group SSFM for PSE management.
    In general all the secure store and forward Functions all begin with SSF*
    The function you choose probably just adds certificate to BSP connection.
    I havent tried it. Just quickly looked at the code.
    Cheers
    Phil.

  • Using MySQL with Java

    Hi, I am writing a database program, and I decided I should try and use MySQL since many people have told me it is the best way to make a database. Does the java version that Sun provide come with the api to create mysql databases?
    Also, I would like to know of a good tutorial that teaches MySQL with java.

    Hi, I am writing a database program, and I decided I
    should try and use MySQL since many people have told
    me it is the best way to make a database. Does the
    java version that Sun provide come with the api to
    create mysql databases?
    You are more than a bit confused so please stop here until you understand the following.
    JDBC is the API for communicating with relational databases in Java. It is not a database in and of itself but it can communicate with any database that provides JDBC API access in the form of a JDBC driver.
    Also, I would like to know of a good tutorial that
    teaches MySQL with java.The Sun tutorial on JDBC may be found here http://java.sun.com/docs/books/tutorial/jdbc/index.html
    Your using (or not) MySQL is not relevent on this forum and any questions you have regarding MySQL (with the exception of one) are beyond the scope of this forum.
    The exception is "Is there a JDBC driver for MySQL and how do I use it". The answer to that question is yes and see this http://www.mysql.com/products/connector/j/

  • Integrating Workflow with WebDynpro

    Hi Guys,
                  I am making some altrations to the Workflow integrated with WebDynpro ABAP.
    Once we maintain the Task and WebDynpro application in SWFVISU and Register in UWL,
    Is that the context has been genarated automatically in component controller with structures in task container and an Interface with the name of the application.
    If its not, how to interface Task container data structure with component controller and how to create interface to access task container data.
    Thanks

    HI Geek,
    We are trying to retrieve the workitem id from the web dynpro abap application.
    We have the similar issue and we have done the all things but some where, some things is missing.
    1. When we debug the application, from within the R/3, it directly goes to the init method of the main view.
    We are trying to debug the window - handle default method code, but the control is not able to reach that part. Plz suggest.
    2. Also, can u plz send the steps, to be in place, to retrieving the workitem id from the workflow in the web dynpro application.
    Thanks and Regards,
    Anil.

  • Flex with WebDynPro

    hi all.
    can anyone tell me ..if we can use Flex with WebDynPro.....?
    can we develop flex in NWDS....?
    Regards,
    Sudheer

    Well you can use Flex inside plain HTML pages.  It isn't really much different when using them inside JSP.  I'm really just talking about embedding and hosting the flash player.  If you want greater interactivity between the Flex portions and the JSP I suggest that you search on the internet for FABridge (Flex Ajax Bridge).  This allows you to use JavaScript to interactive with the flex component.  I've used this technology within BSP quite a bit:
    [/people/thomas.jung/blog/2007/11/14/an-introduction-to-flob-flex-on-bsp|/people/thomas.jung/blog/2007/11/14/an-introduction-to-flob-flex-on-bsp]
    Since BSP and JSP are so similar, the same concepts could easily be applied in JSP.
    As to the Web Dynpro Islands - the development of the first version is complete and will start to ship in a controlled rollout with Web Dynpro ABAP in NetWeaver Enhancement Package 1 (Q3 2008). I believe that at first we plan to only have SAP delivered components, but will eventually open it up so that anyone can create components that run within the Islands.

  • Configuring mysql with J2EE

    Hi Im a newbie in J2EE. (just started learning it 2 days back that new..;-)
    I managed to set up a simple application using the J2ee tutorial. Now i want to try out a database application. I have a mysql database installed. Can anyone guide me on how to setup mysql with j2ee server? Are there any online tutorials etc that would help me in this?
    I actually managed to create a connection pool however when i try to ping it i get an error message with says "An error has occurred. Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource" .
    I hav already set classpath of mysql driver. Do i need to copy the jar file to any other directory?
    Im not too sure if the way i have created connection pool is right, but i used the defaults specified so i guess that should be ok.
    Any Help would be appreciated.
    Thanks in advance.

    Hi! I�m Brazilian and I�ve been learning the English language yet, but I�ll try to describe how to configure J2EE with MySQL.
    I am using MySQL version 4.1.7 with J2EE version 1.3 on Windows XP Professional. The driver version of MySQL is 3.0.16.
    You have to configure the following two files:
    - <J2EE_HOME>\bin\setenv.bat
    - <J2EE_HOME>\config\resource.properties
    Do the following steps:
    1) Copy the JAR file of MySQL driver (mysql-connector-java-3.0.16-ga-bin.jar) to <J2EE_HOME>\lib directory.
    2) In <J2EE_HOME>\bin directory open the setenv.bat file and analize the code. It is not hard to understand the code, it is just the classpath configuration of J2EE. After understand it, add a reference of MySQL driver (mysql-connector-java-3.0.16-ga-bin.jar), that was copied to <J2EE_HOME>\lib directory.
    3) Run the <J2EE_HOME>\bin\j2eeadmin.bat to configure the resource.properties file.There are two command lines to be executed, as below:
    - j2eeadmin.bat -addJdbcDriver <CLASS NAME OF THE DRIVER>
    - j2eeadmin.bat -addJdbcDatasource <JNDI NAME> <URL>
    For example:
    - j2eeadmin.bat -addJdbcDriver "com.mysql.jdbc.Driver"
    - j2eeadmin.bat -addJdbcDatasource "jdbc/mysql/test" "jdbc:mysql://localhost/test?user=username&password=pass"
    4) After run j2eeadmin.bat, the resource.properties file will be modified. But when I did it and when I executed the verbose command to start J2EE, some error messages was exhibited. So I decided to open the resource.properties file and I noticed hat the character "\" was added erroneously in a lot of places of the code. It did not seem correct, so I decided to remove these characters replacing them. Bingo!!! After I did it, I run verbose again and no more message error ocurred. I think it is a bug of J2EE.
    Finish! I modified the datasource JNDI to access MySQL and then I run my EAR application. No problems occurred. My application is running succesfully.
    Good luck!

Maybe you are looking for