Database access with JSP

Hello,
i have a Java Server Page where i fill in some data in a formular. I want to put these data (only two strings) in a database. I already use a servlet to give this data to a (already existing) stateless session bean. I also created and deployed an sda, so that the table exists in the database.
But i do not understand, what to do next - how to use an entity bean to fill the table.
Can anyone give me some hints?
Thanks,
André

Hi Andre,
you need to retrieve the Home Object of your entity bean and use it to create, the same way you create your session bean.
Example:
InitialContext initialContext = new InitialContext();
EjbObject myEjb = null;
try {
  java.lang.Object objRef = initialContext.lookup(EjbHome.JNDI_NAME);
EjbHome home = (EjbHome)PortableRemoteObject.narrow(objRef, EjbHome.class);
         myEjb = home.create();
} catch (Exception) {
         initialContext.close();
The lookup to the home object can vary, you might also have helper classes for that, it depends on your application server, API and architecture.
But however the call or whichever the server, you basically need to retrieve the home object of your entity bean and use the method create() - with any required parameters. Pretty much the same way you create a session bean.
Hope this helps.
regards,
Dionisios

Similar Messages

  • Database access with JSP custom tags

    i have created one file in which i am making the connection with mysql data base with con.mysql.jdbc.Driver.and usking J connector and that i'm doing with custom tag.this is the error which i'm getting in tomcat.
    and the tag handler class and TLD file and jsp file is below
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax.servlet.jsp.JspException: null
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl .java:841)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.j ava:778)
    org.apache.jsp.DbTry_jsp._jspService(org.apache.jsp.DbTry_jsp:72)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.NullPointerException
    Try.Connect.<init>(Connect.java:26)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    java.lang.Class.newInstance0(Unknown Source)
    java.lang.Class.newInstance(Unknown Source)
    org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:116)
    org.apache.jsp.DbTry_jsp._jspx_meth_db_connect_0(org.apache.jsp.DbTry_jsp:84)
    org.apache.jsp.DbTry_jsp._jspService(org.apache.jsp.DbTry_jsp:62)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.4 logs.
    Apache Tomcat/5.5.4
    Tag handler class
    package Try;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspWriter;
    import javax.servlet.jsp.PageContext;
    import javax.servlet.jsp.tagext.TagSupport;
    import java.sql.*;
    public class Connect extends TagSupport {
    private String driver = "com.mysql.jdbc.Driver";
    private String dbtype = "mysql";
    private String host = "localhost";
    private String username = "root";
    private String password = "203131";
    private String database = "compose";
    private String scope = "page";
    private String id = "";
    JspWriter out = pageContext.getOut();
    public void setDriver(String str) {
    driver = str;
    public void setDbtype(String str) {
    dbtype = str;
    public void setHost(String str) {
    host = str;
    public void setUsername(String str) {
    username = str;
    public void setPassword(String str) {
    password = str;
    public void setDatabase(String str) {
    database = str;
    public void setScope(String str) {
    scope = str;
    public void setId(String str) {
    id = str;
    public int doStartTag() throws JspException {
    try {
    Class.forName("com.mysql.jdbc.Driver");
    String url= "jdbc:" + dbtype + "://" + host + "/" + database;
    Connection connection = DriverManager.getConnection(url,username,password);
    out.println("right ;;one");
    catch (SQLException e1) {
    System.out.println("Error in HeadingTagv: " + e1);
    catch (Exception e) {
    System.out.println("Error in HeadingTag: " + e);
    return SKIP_BODY;
    TLD is lib.tld
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
    <taglib>
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    <short-name>db</short-name>
    <display-name>Database Tags</display-name>
    <description>
    A set of tags for working with SQL database access
    </description>
    <tag>
    <name>connect</name>
    <tag-class>Try.Connect</tag-class>
    <body-content>empty</body-content>
    <description>
    </description>
    <attribute>
    <name>driver</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    </description>
    </attribute>
    <attribute>
    <name>dbtype</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    </description>
    </attribute>
    <attribute>
    <name>host</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    Host name of the computer where database is located.
    Default is "localhost".
    </description>
    </attribute>
    <attribute>
    <name>username</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    Username for logging onto the database.
    Default is "root".
    </description>
    </attribute>
    <attribute>
    <name>password</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    Password for logging onto the database.
    Default is the empty string.
    </description>
    </attribute>
    <attribute>
    <name>database</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <description>
    Can be given by a run-time expression.
    The name of the database that will be used for
    the SQL commands. Default is no database specified.
    </description>
    </attribute>
    <attribute>
    <name>id</name>
    <required>false</required>
    <description>
    </description>
    </attribute>
    <attribute>
    <name>scope</name>
    <required>false</required>
    <description>
    </description>
    </attribute>
    </tag>
    </taglib>
    JSP file is
    <%@ taglib uri="/WEB-INF/lib.tld" prefix="db" %>
    <html>
    <body>
    <db:connect username="root" password="203131" database="compose" />
    </body>
    </html>

    Answered in your other post:
    http://forum.java.sun.com/thread.jspa?threadID=608780&tstart=0

  • Database Access through JSP

    Hi im trying to access my ORACLE database through a jsp program. The page loads up in the browser, no errors or anything like that, but i get no output.
    I am running things on localhost with TomCat 3.2.3
    Here is the code, any help gratefully appreciated.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Testing Database Access</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FDF5E6" TEXT="#000000" LINK="#0000EE"
    VLINK="#551A8B" ALINK="#FF0000">
    <CENTER>
    <TABLE BORDER=5 BGCOLOR="#EF8429">
    <TR><TH CLASS="TITLE">
    Testing Database Access</TABLE>
    </CENTER>
    <P>
    <P>
    Here Is what Might be in the Database
    <P>
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="oracle.jdbc.driver.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="java.sql.*" %>
    <%
         try
    %>
    <%
         DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         String username = "Donnchadh", password = "zcbu5mya";
         Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@kiwi.isg.computing.dcu.ie:1521:kiwi",username,password);
         java.sql.Statement stmt = conn.createStatement();
         String query = "SELECT * FROM PERSONALS";
         ResultSet rs = stmt.executeQuery(query);
         while(rs.next())
              int ccount = rs.getMetaData().getColumnCount();
              for( int i = 1; i <= ccount; i++ )
                   System.out.print(rs.getString(i)+"\t");
              System.out.println();
    %>
    <%
         rs.close();
         stmt.close();
         if(conn != null)
              try
                   conn.close();
              catch(Exception e)
                   return;
         catch(Exception e)
              return;
    %>
    <P>
    </BODY>
    </HTML>
    I have also tried to access columns directly with this code in the while loop
    while(rs.next())
                        String Title = rs.getString("title");
                        String FName = rs.getString("fname");
                        String LName = rs.getString("lname");
                        String Phone = rs.getString("phone1");
                        String Phone2 = rs.getString("phone2");
                        String Addr = rs.getString("addr");
                        String County = rs.getString("county");
                        String Country = rs.getString("country");
                        out.println("<tr><td>" + Title + "</td><td>" + FName + "</td><td>" + LName
                        + "</td><td>" + Phone + "</td><td>" + Phone2 + "</td></tr>" + "</td></tr>" + Addr
                        + "</td></tr>" + County + "</td></tr>" + Country + "</td></tr>" );

    i give a servlet access to oracle ,that have test ok!
    import java.sql.*;
    import javax.servlet.*;
    import javax.sql.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class TestServlet1 extends HttpServlet {
    private static final String CONTENT_TYPE = "image/jpeg; charset=GBK";
    //Initialize global variables
    String strRno =null;
    ResultSet rs=null;
    byte [] buf=null;
    InputStream in;
    int IntNo;
    public void init() throws ServletException {
    //Process the HTTP Get request
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    // PrintWriter out = response.getWriter();
    // System.out.println("TEst database prepaired ok��");
    strRno = request.getParameter( "PictNo" );
    IntNo = 0;
    if( strRno != null ) {
    try { IntNo = Integer.parseInt( strRno ); }
    catch( NumberFormatException e ) {
    strRno = null;
    System.out.println("��������������������"); }
    else
    System.out.println("��������������������");
    if( strRno == null ) {
    // response.sendError( HttpServletResponse.SC_NOT_FOUND );
    return;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    catch (ClassNotFoundException ex2) {
    //      out.println("TEst2��");
    // System.out.println("TEst2�� ex2��");
    String url="jdbc:oracle:thin:@erdos00:1521:erdos";
    Connection con = null;
    try {
    con = DriverManager.getConnection(url, "system", "manager");
    catch (SQLException ex1) {
         //out.println("TEst�� ex1");
         System.out.println("TEst�� ex1��");
    // PreparedStatement sql=con.PrepareStatement("select photo from blob_test WHERE rno = IntNo" );
    PreparedStatement sql = null;
    try {
    sql = con.prepareStatement("select photo from blob_test WHERE rno = 14 ");
    // sql = con.prepareStatement("select photo from blob_test WHERE rno = " +"+ IntNo +" );
    catch (SQLException ex) {
         //out.println("TEst�� ex");
         System.out.println("TEst�� ex��");
    //method prepareStatement(sting) not found in interface java.sql.connection
    // sql.setInt( 1, rno );
    try {
    rs = sql.executeQuery();
    catch (SQLException ex3) {
         //out.println("TEst�� ex3");
         System.out.println("TEst�� ex3");
    System.out.println("TEst database operate ok��");
    // out.println("TEst database operate ok��");
    //��������������������
    try {
    if (rs.next()) {
    buf = rs.getBytes(1);
    in = rs.getBinaryStream("photo");
    else {
    buf = new byte[0];
    }catch (Exception e){
    //throw e;
    response.reset();
    //������image/jpeg������������������������
    response.setContentType("image/bmp");
    // ��bmp��jpeg
    byte[] b = new byte[1024*1024];
    int len;
    while((len=in.read(b)) >0)
    response.getOutputStream().write(b,0,len);
    OutputStream out1 = response.getOutputStream();
    out1.flush();
    out1.write(buf);
    in.close();
    try {
    rs.close();
    catch (SQLException ex4) {
    // out.println("<html>");
    // out.println("<img src='http://192.168.0.1/examples/servlet/TestServlet1?PictNo="+IntNo+"'>");
    // out.println("</html>");
    out.println("<html>");
    out.println("<head><title>TestServlet</title></head>");
    out.println("<body bgcolor=\"#ffffff\">");
    out.println("<p>The servlet has received a GET111111111. This is the reply.</p>");
    out.println("</body></html>");
    //Process the HTTP Post request
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head><title>TestServlet</title></head>");
    out.println("<body bgcolor=\"#ffffff\">");
    out.println("<p>The servlet has received a POST. This is the reply.</p>");
    out.println("</body></html>");
    //Process the HTTP Put request
    public void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    //Process the HTTP Delete request
    public void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    //Clean up resources
    public void destroy() {
    hope u can get some thing from that

  • Database access in JSP?

    Can I easily access MS access using JSP? If it is, what kind of drive should be used to access the MS Access database?
    Thank you so much!

    <%!
    // define database parameters
    String host="localhost";
    String user="";
    String pass="";
    String db="";
    String conn;
    %>
    <%
    Class.forName("org.gjt.mm.mysql.Driver");
    // create connection string
    conn = "jdbc:mysql://" + host + "/" + db + "?user=" + user + "&password=" +
    pass;
    // pass database parameters to JDBC driver
    Connection Conn = DriverManager.getConnection(conn);
    // query statement
    Statement SQLStatement = Conn.createStatement();
    This is when accessing a database in a JSP, not a javabean... Try searching this forum, there are LOTS of topics about this.

  • How to handle and Manage Multi DataBase access with LCDS in runtime ?

    Hello there
    I got several customer working with the same application and I wonder how,  with LCDS,  to manage  in a runtime a multi dataBase access; without creating a configuration "mxl" file in
    the folder catalina for each database.
    Indeed, each customer have their own dataBase, and so far, I did not find out how to avoid creating a config xml file in catalina for every single database; which force me to create as well for each customer a  folder application, since the name of the config file in catalina require a folder application to be ran under tomcat....
    Thus, my question is :
    Is there anyway to create only one configuration mxl file in catalina (in the server side) and then from the client side (application) let the user select its environment (meaning its database) to run the application.... this technic can be also used for multi database environment such as : Dev / Test / Prod   environment (or database) where the same application can access to.
    Please if any one have an idea or already delt with; just let me know, because I'm entering in a bootle neck and the situation is getting serioulsy critical....
    Regards

    Hello Ulrich,
    with compact and repair I mean the MSAccess function "Compact and Repair".
    Please follow the link below for more details:
    http://office.microsoft.com/en-us/access-help/compact-and-repair-an-access-file-HP005187449.aspx
    Normally you can execute this function directly in Access or with the Windows ODBC Data Sources Administrator  => "Control Panel" => "Administrative Tools" => "Data Sources (ODBC)"...
     I want to execute this function via cvi code and not by hand ;-).
    Thank you for your support.
    Frank

  • Database connection with jsp?

    any database (access preferred)

    kajbj wrote:
    What's the question?"give me teh codez", of course. ;-)

  • Problem when inserting "Thai language" string to MS Access with JSP

    Dear sir,
    I have the problem when try to insert "Thai langusge" string to MS access database through JDBC in JSP page.
    The JSP page is shown in the following.
    <HTML><HEAD><TITLE>Personalt Information</TITLE>
    <%@ page contentType="text/html; charset=MS874" %>
    <%@ page import = "java.io.*" %>
    <%@     page import = "java.lang.*"%>
    <%@     page import = "java.sql.*"%>
    <%
              Connection dbconn,conn;
              ResultSet results;
              String sql;
              Statement stmt;
              // Creating a conection with a database
              String url = "jdbc:odbc:bg3hrDB"; // the database file.
              //Statement stmt;
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   dbconn = DriverManager.getConnection(url);
                   stmt = dbconn.createStatement();
                   ResultSet rs;
    %>               
    %>
    <%
              String code=new String(request.getParameter("code").getBytes("ISO8859_1"),"MS874");
              String status=new String(request.getParameter("status").getBytes("ISO8859_1"),"MS874");
                   String fname=new String(request.getParameter("fname").getBytes("ISO8859_1"),"MS874");
                   sql = "INSERT INTO employee VALUES (' "+ code +" ',' "+ status +" ',' "+ fname +" ')";
    stmt.executeUpdate(sql);
    %>
    <%=fname%> //In this line, "fname" can show "Thai" correctly
    But after inserted to database, the record in Access was always show "?????" instead of "Thai"......
    How can i solve this?
    Thank you for your kindness in advances.
    Yongyos K.

    It's a pain in the butt, but you'll have to write your own character set conversion to handle the problem. Check out the link shown below (just replace BIG5 in the example with MS874):
    http://www.geocities.com/siufai6/java/JDBC_Chinese.html
    ;o)
    V.V.

  • Database Access from JSP

    I'm trying to access a SQL Server database through an ODBC connection on a JSP page and having difficulties. This is the code that I'm using:
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:ODBCConnection", "username", "password");
    Statement stmt = conn.createStatement();
    ResultSet results = stmt.executeQuery(
    "SELECT numUserID, txtUsername, txtPassword FROM tblUsers");
    while (results.next()) {
    int DBuserid = results.getInt("numUserID");
    String DBusername = results.getString("txtUsername");
    String DBpassword = results.getString("txtPassword");
    conn.close();
    } catch (Exception exc) {                              
    out.println ("Exception \"" + exc + "\" occured....<br>");
    exc.printStackTrace();
    I've got two servers I'm testing it on. One is the IBM WebSphere 3.5 on Windows NT 4 and the other one is the Oracle 9i Server (Apache) with java support on Windows 2000. The code works fine on the Oracle server, but does not work on the WebSphere. I am getting a "java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Client unable to establish connection" exception. The problem is that I need to run this thing on the WebSphere server.
    I guess this might have something to do with the Java server differences or OS differences, but I don't know what that could be. I'm sure there's something that I'm not doing right, I just need some help figuring out what that is. I'd appreciate any help anyone can provide. Thanks.

    ODBC connection is set up the same on both servers and works with Access. In fact, I have tried to put the same code that I'm trying to use in a regular text java file, it compiled and ran on that same server. I've got a feeling I have the Websphere server setup wrong, but I don't know exactly what and how to fix it.
    Thanks.

  • Sharing Portal database connection with JSP page

    Hi out there,
    I implemented a JSP page as a selection form to be integrated into Oracle Portal. This JSP page contains a 'dynamic' form which needs to send queries to the database also integrated in the Portal.
    For this I am currently using a JDBC connection but I would prefer to use the internal db connection of the Portal System.
    Explanation: The user has to log in to the Portal and after that can call the JSP form. To poulate some comboboxes within this form I need some data from the database and the user does have READING privileges on that database.
    Can anybody tell me how to use the user's login and password (or the established connection) to fetch the needed data from the database OTHER than with a jdbc connection?
    Thanx in advance!
    Cheers,
    Thomas

    sorry. not going to happen. you're running in a completely different environment when running Java on Portal. Portal is running in the database; your Java is running on the application server. your Java code must use JDBC to access any database resources, even if Portal related.
    it is essential that you implement a connection pool on the application server to optimize your database traffic. check out bitmechanic for a very good open source option.
    good luck,
    rich

  • Database Access from JSP - Is it correct?

    From a JSP Page, we need to retreive data from the database. We have our own application specific API commands to retreive data from database. We have doubts in using this API commands.
    Approach 1:
    From the jsp, send the query details to a Java file (BO). From the java file (BO), call the database and retreive the data
    Approach 2:
    Use the API command directly from the jsp page to retreive details from the database.
    In both approaches, the same API command is going to be used. We just want to know is there any advantage in calling the database through the java file (BO) instead of directly from the jsp?
    Regards,
    R.Aravinth

    Thanks Ram. But we are not going to have any complex
    codes written for data retreival. We just epxect a
    single line of code which will call database and that
    API command will return us a storage variable which
    we will use for displaying purpose.
    ok take a look at this
    //code to display lot of other stuff
    <%
        try {
           //code to access db and get data;
        catch(SomeException e){
            //oh-oh you are already on the display logic and have output a lot of stuff
            //how do you handle this
    %>versus this
    //code in some handler or bean
       try{
               //code to get data
              //set an attribute to enable a redirect to jsp page
        catch(Exception e){
              //handle exception, log ?
              //set an attribute to enable a redirect to error page
    Anyways, i wanted to know will the performance of the
    page improve if we call the database from a separate
    java rather than directly from jsp?As evnafets said, the answer is no. It may even be faster :)
    cheers,
    ram.

  • Database access with xslt document

    Hello,
    I have a big problem. I have a database with three tables and more than hundred records. From the records of these three tables a xml document should be generated. I already have a xslt file which gets the data from the database and brings in a xml form. Is there in BPEL a possibility with the help of a xslt file to access a table? And if so like this is done? Can one give the xslt file in the data bank adaptor? The xslt file has the following appearance:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <xsl:apply-templates select="RESULTSETS/SELECT[@NAME='idoc_element']">
    <xsl:with-param name="parent_id" select="'0'"/>
    </xsl:apply-templates>
    </xsl:template>
    <xsl:template match="RESULTSETS/SELECT[@NAME='idoc_element']">
    <xsl:param name="parent_id"/>
    <xsl:for-each select="ROW[(parent_id=$parent_id)]">
    <xsl:variable name="element_name" select="name"/>
    <xsl:variable name="element_id" select="id"/>
    <xsl:variable name="position" select="position"/>
    <xsl:variable name="child" select="/RESULTSETS/SELECT[@NAME='idoc_element']/ROW[(parent_id=$element_id)]"/>
    <xsl:element name="{$element_name}">
    <xsl:for-each select="/RESULTSETS/SELECT[@NAME='idoc_attribute']/ROW[(element_id=$element_id)]">
    <xsl:variable name="attr_name" select="name"/>
    <xsl:attribute name="{$attr_name}"><xsl:value-of select="value"/></xsl:attribute>
    </xsl:for-each>
    <xsl:choose>
    <xsl:when test="$child">
    <xsl:apply-templates select="/RESULTSETS/SELECT[@NAME='idoc_element']">
    <xsl:with-param name="parent_id" select="$element_id"/>
    </xsl:apply-templates>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="value"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:element>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    This xslt forms a loop about the suitable data and joins them to a xml file.
    It would be really great if somebody could help me there.
    Thanks
    Greeting Cathleen

    Hello,
    I know that I can define the relations between the tables in the DB Adapter.
    But how do I say to him which data he from the tables should get and how should these be joined?
    Since my tables are built up as follows:
    Table 1 contains the head of the xml document.
    Table 2 contains the attributes.
    And table 3 contains the real elements of the xml document.
    This is, for example, table 3:
    Element | Name | Value
    /root/E1 | E1     
    /root/E1/E2 | E2
    /root/E1/E2/E21 | E21 | 7777
    /root/E1/E2/E22 | E22 | Germany
    /root/E1/E3 | E3 | UTIL
    And this structure should have afterwards the following construction:
    <root>
    <E1>
    <E2>
    <E21>7777</E21>
    <E22>Germany</E22>
    </E2>
    <E3> UTIL </E3>
    </E1>
    </root>
    Besides, subdivide themselves Element2 and Element3 and there is of it more than 100. It is very big xml document at the end.
    So a xml file should originate only from the records of the table and I know not at all like I should do this with the DB Adapter. OR as I give in the DB Adapter or where I give it.
    It would be really very nice and helpful ones if somebody can help me there. This is since very important for my work.
    Thanks
    Greeting Cathleen

  • Database access with Jave Web Start

    Can a java application, that has been deployed by using Java Web Start, access information from a database that's located on the web server from where the application was deployed?

    Yes, if you use the type 4 (ie, thin) driver and include the driver's jar file as part of the app.
    Technically you can do it with a thick driver but then you have first install the driver on the client machine and I assume this isn't what you are looking for,

  • Server side database access with Applets?

    Does anyone know how to do this without any JDBC or any other expensive, server heavy and special requirements?
    Who could be interested in this?
    Am i the only one?
    Most internet hosts, rented i mean, do not give many possibilities you have PHP and not much more to access a MySql or other database engine.
    If you want to build an aplication, a decent one, you must use java Applet because server side Java is not very interesting and is very expensive.

    Personally, I think server-side Java is very interesting and would disagree that a decent web application necessarily requires applets.
    I use Supplehost for their reliable and inexpensive Java hosting service.
    Many sites and applications make use of cross-browser DHTML and Java server technologies (JSP and servlets) are ideal for building and delivering data-driven DHTML pages.
    Of course applets have their advantages but, without a server providing access to data in a database, they're effectively working just as a static web page.
    There are other interfaces to databases: for example, Microsoft SQL Server provides the means to interrogate SQL databases through the underlying web server and to have the results returned in XML format.
    For me, J2EE provides the best tools for developing data-driven applications and the question over which client should do the presenting is more often one of how best to cater for the intended audience: cross-browser DHTML is best in some circumstances, applets in others, Macromedia Flash in others.
    Check out Supplehost's site: you get SSH and secure FTP access to a shared server, can install and run servlets and JSP applications and upload, configure and restart your applications very easily:
    http://www.supplehost.com
    Chris.

  • How to acress Microsoft Office Access with jsp

    can anyone tel
    -the Driver class file to use
    -how to connection to the Movie database

    i still cant connet with
    this
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //load the driver
    String url = "jdbc:odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=Movie.mdb";
    Connection con = DriverManager.getConnection(url);
    got an error
    org.apache.jasper.JasperException: [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'.

  • Database Access with JspDynpage

    Hi,
    I want to know if it ist possible to access the WAS Database over JspDynpage.
    If yes, can someone post me a tutorial or the way how to do that?
    Thanks and Regards,
    Dennis

    Hi Dennis,
       U can create a connection and do datasource lookup and access the database.
    InitialContext contx = new InitialContext();
    DataSource datasource = (DataSource)contx.lookup("jdbc/SAP<SID>DB");
    Connection connection = datasource.getConnection();
    Statement stmt = connection.createStatement();
    ResultSet rs = stmt.executeQuery("Select * from table");
    Also refer to this link for another example.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fe/68e343cc68414da4426258d3e896ae/content.htm
    Regards,
    Harini S

Maybe you are looking for

  • NOT Able to print the Report output in the Printer

    Hello guys I have a concurrent Program-which is a report.A printer is installed in Oracle apps and i have assigned that printer to the concurrent Program.Now the problem is when i run the report after giving number of copies as 1 in options button,th

  • Captivate 5 Movie won't load in any browser

    Suddenly my Captivate version 5 movies will not load in any Browser. I have 4 files the html file, the swf file, the swf skin file, and file called standard The .swf file will open in Flash but when I open the html file it will not open the movie. I

  • Is it possible to move files under shared review?

    Hi, With Acrobat X Pro I published pdf documents for shared review on a network drive. Now I want do reorganize these pdf files on the network drive. I want to group documents within subfolders. What I can do is move the documents manually and afterw

  • Attach the whole form with XML data when Emailed

    Hi all I am new to Adobe Livecycle product. I have been using IBM workplace forms and now want to migrate to Adobe Forms. I want the whole completed PDF form to be attached along with the xml data in it when someone clicks the email button and email

  • Can somebody explain to me how java and xml are related?

    Hi guys im new to java and xml.Been reading a lot regarding java and don't seem to have a problem with it... the problem is the xml part...im doing a simple GUI project using swing(online store) and i have to convert it to xml I have absolutely NO ID