3 tiers model with Java and Oracle.

Hi everybody. I have a problem with my work. I want to design a simple program follow 3 tiers model with Java and database is Oracle. But I do not know how I can design them. Please help me. It will better if you give some source code for each layer.
Thanks in advance.
Ky Thanh.

I'd suggest searching the net for tutorials. Pick out the things you don't know about and need to know (SQL? JDBC? Java? software design in general?) and google: tier architecture, sql tutorial, etc. Sun's Java & JDBC tutorials are at http://java.sun.com/learning/tutorial/index.html
Source for each tier? Read the JDBC tutorial and you can write the database tier source yourself. Learn Swing/Servlets/whatever you use for the user interface and you can write the top tier. The middle tier is your business logic, which is dependent on your area of business, and you'll need to know about the business and just general programming. Then if the tiers need to be distributed (hopefully not), you'll need to learn EJB or something.
I hope you haven't been given a task there you aren't ready to take on... Learning to swim by jumping into the river is a great way to learn in a school assignment, but you mention work, and learning that way at work sounds a bit risky to me.

Similar Messages

  • Problem with Java and Oracle Database -  help !

    i keep getting a NullPointerException when trying to
    update a resultSet in a servlet. i am bringing in the data
    just fine from an Oracle database. but it chokes when trying
    to update it. can anybody tell me what is happening?
    thanks for any help
    Owen
    ResultSet rs = stmt.executeQuery( "select * from sw_assets" );
    rs.next();
    rs.updateString("name","XXX"); <--- BOOM !
    java.lang.NullPointerException
    at sun.jdbc.odbc.JdbcOdbcBoundCol.setRowValues(JdbcOdbcBoundCol.java:240)
    at sun.jdbc.odbc.JdbcOdbcResultSet.updateChar(JdbcOdbcResultSet.java:3767)
    at sun.jdbc.odbc.JdbcOdbcResultSet.updateString(JdbcOdbcResultSet.java:3257)
    at sun.jdbc.odbc.JdbcOdbcResultSet.updateString(JdbcOdbcResultSet.java:3848)
    at _0002fopen_0002ejspopen_jsp_3._jspService(_0002fopen_0002ejspopen_jsp_3.java:87)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)

    ResultSets based on a wildcard are generally treated as views by Oracle, meaning they are not updatable no matter how you create your statement. Try either "select swa.* from sw_assets swa" or "select all from sw_assets swa", that should get around the problem.
    Also (just being thorough) make sure that you specifically created your statement as being updatable (stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE) ).
    I would not normally expect a NullPointerException when encountering this "feature", but then I don't often use the ODBC bridge.
    Good luck! I hope this helps.

  • Problem with java and pogo games

    i use mozilla and now with the problems with java and hackers cannot play my pogo games,what can i do? i disabled my java i tried java 6 doesnt work or is not safe,what is a safe way to play games on pogo that use java?

    Oracle has released a Java 7 Update 11 to address security vulnerabilities and you should update to that version.
    *https://support.mozilla.org/kb/how-to-use-java-if-its-been-blocked
    See also:
    *http://kb.mozillazine.org/Java#Windows_installation_issues
    You can find the latest Java version on the Oracle website.
    See Java Platform > Java SE 7U11 and Java 6U38 (Download JRE)
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html

  • How to relate java and Oracle

    i have to tried to make programs using java and oracle. if i give the values in the 'insert' statement it is getting updated in the original table in oracle but how to take the values from the text fields of java and insert into the tables in oracle. do we have any methods to convert the values into sql type. pl reply.

    Here is a sample of a Java program that uses JDBC and a PreparedStatement. This particular program does a select, but you can also use this for inserts. I'm not 100% this is what you are looking for, but if it isn't just let me know. I'll help if I can.
    Joel
    For inserts, just replace this code:
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
      System.out.println(rs.getInt(rs.findColumn("CNT")));
    }with this code (and obviously change the Select string to an Insert String):
    int rowcnt = ps.executeUpdate();Here is the whole program:
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    class dbtest {
        public static void main(String args[]) throws SQLException {
            try {
                String timeString = new String("2000-11-01 23:59:59");
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd H:m:s");
                java.util.Date date = format.parse(timeString);
                Timestamp timestamp = new Timestamp(date.getTime());
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                Connection conn =
                    DriverManager.getConnection(
                        "jdbc:oracle:thin:@riker:1521:mydb",
                        "myusername",
                        "mypassword");
                String sql =
                    "SELECT COUNT(*) CNT FROM SERVICE_ALARM "
                        + "WHERE TRANS_STREAM_NODE_ID = ? "
                        + "AND SERVICE_ID = ? "
                        + "AND ALARM_ID = ? "
                        + "AND RAISED > TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')";
                PreparedStatement ps = conn.prepareStatement(sql);
                ps.setString(1, "ROW1");
                ps.setInt(2, 1);
                ps.setString(3, "ROW1");
                String myDate =
                    timestamp.toString().substring(0, timestamp.toString().length() - 2);
                System.out.println("myDate=(" + myDate + ")");
                ps.setString(4, myDate);
                ResultSet rs = ps.executeQuery();
                while (rs.next()) {
                    System.out.println(rs.getInt(rs.findColumn("CNT")));
                rs.close();
                ps.close();
            } catch (Exception e) {
                System.out.println("Java Exception caught, error message=" + e.getMessage());
    }

  • The performance of management system with Java and MySQL

    Hi all,
    I want to develop one management application with Java and MySQL. However I am not sure which is a good way to design the system. The system has to deal with customers' data in the database.
    Should I create objects for every customers when application starts so that I do not need to access to the database often? Or
    Should I access to the database everytime the user want to deal with customer's data?
    Welcome for any suggestion.
    Thank you
    Pat

    Hi
    i i think u should go through MVC model or use connection pooling

  • Relation between java and oracle

    Hi,
    This is general information about java and oracle.
    I had worked in java last one year, but now switch to oracle i heared that nearly combination of each are implemented oops concept. But i know where it used in java, not in oracle.
    In oracle, where we are implemented inheritance, polymorhism and encapsulation.
    plz give some tips
    Regards venki

    does this mean you used to develop your applications on java and manuplate your data in Oracle over JDBC or Hibernate but then you started to develop PL/SQL applications for this need and use PL/SQL's OO features?
    With my experiences I may say if you are working on data intensive database applications learning how to use effectively SQL and PL/SQL is critical, this is Oracle's native language not something written to work for any database vendor. http://www.oracle.com/pls/db102/portal.portal_db?selected=5

  • Events problem with (Java and ActiveX)

    Hi,
    I use an ActiveX component with Java and i've got a problem with events.
    Java classes were generated with Bridge2Java (IBM).
    In order to manage events I added a listener in my application :
         javaMyActiveX = new MyActiveX();
         javaMyActiveX.add_DMyActiveXEventsListener(new _DMyActiveXEventsAdapter());
    I also added a constructor in the _DMyActiveXEventsAdapter class and I fill the body of methods.
    The ActiveX generates two types of events :
    - The ones are directly generated by methods.
    - The others are generated by a thread.
    With MS Products (VB, Visual C++, Visual J++), I catch all events.
    With java (jdk 1.4), I catch only events generated by methods.
    Can anyone help me.

    I'm not 100% sure, but the last time I used that bridge, it only worked if you ran your Java app within a Microsoft VM.

  • Create PDF report with APEX and Oracle 11g doesn't work

    Hi everyone,
    I have a problem with the downloading of PDF reports from APEX with Oracle 11g.
    When I try to download a PDF, Acrobat Reader says it can not open the file.
    I have done the same test in an environment with APEX and Oracle 10g and it works perfectly.
    Does anyone know if there is a known bug for version 11g.
    Thank you very much.

    Hi Munky,
    I open the generated file the Notepad++ I can read the next message:
    *<HTML><HEAD><TITLE>500 Internal Server Error</TITLE></HEAD><BODY><H1>500 Internal Server Error</H1>OracleJSP:*
    An error occurred. Consult your application/system administrator for support. Programmers should consider setting the init-param <code>debug_mode</code> to "true" to see the complete exception message.</BODY></HTML>
    I have not idea can I solve the problem.
    Have you got any solution for this problem??
    Thank you so much.
    Victor Muñoz.

  • Java and oracle in linux

    hello frnds...i have installed oracle 10g in ubuntu 11.04....now i want to make database connection between java and oracle...so how can i do it??i know the java code..but the main problem is database driver..how can i give the classpath for specific jdbc dirver...pls tell me the steps to set classpath for jdbc driver...
    thnx in advance..

    884540 wrote:
    hello frnds...i have installed oracle 10g in ubuntu 11.04....now i want to make database connection between java and oracle...so how can i do it??i know the java code..but the main problem is database driver..how can i give the classpath for specific jdbc dirver...pls tell me the steps to set classpath for jdbc driver...
    thnx in advance..You can mention the classpath using the javac and java options:
    javac -cp .;<path> <ClassName>.java
    and
    java -cp .;<path> <ClassName>
    Or refer the below link to avoid mentioning classpath everytime you run/ compile the program
    http://www.linuxquestions.org/questions/linux-software-2/j2sdk-install-174483/#post898715

  • Uses for the Action Property with SQL and Oracle DB Adapters

    This thread is a complement to the Wiki Article
    BizTalk: Streamlining WCF SQL and Oracle Messaging-Only and Other Patterns
    The question.  In what circumstances is explicitly setting the Action value with the WCF SQL and Oracle DB bindings useful or beneficial. 
    A complimentary question.  Is it even possible to set the Action value to anything other than exactly what is required by the Message.
    I ask because of three very specific behaviors of the bindings themselves:
    The binding enforces a match between the Action and the Message, therefore...
    There is a one-to-one relationship between the Message and Action, but...
    The binding is able to correctly derive and perform the requested operation with the unspecific CompositeOperation.
    For clarity, I understand how to set the Action. I. understand what the Action represents in the SOAP scheme. I understand how Action can be used as an abstraction for SOAP operations.
    Thoughts?

    Do you have any good suggestion to learn how to use action property with SQL and Oracle DB adapters?  I learn a lot from your replies for years in BizTalk forum. :)

  • Webdynpro java and oracle DB connection..

    Hi,
    I have a good knowledge of WD (web dynpro java) projects having ECC as backend as i have done lot of projects where ECC is backend and WD JAVA is front end.
    but in my new project i have wd java as front end but my backend is oracle DB. I want to know how to create/setup  connection betwen webdynpro java and oracle DB, how to proceed on this ? wat all settings I have to do in VA (visual admin) and all.
    please let me know how to proceed on this. Any document/tutorial on this will be very helpful..

    Hi Rahul,
    Create a DataSource to the oracle db in Visual Admin, give the datasource an alias name and connect to the db from WebDynpro by calling the alias name.
    These document might be useful:
    [http://help.sap.com/saphelp_nw70/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm]
    [SAP Note 867176|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=867176]
    [SAP Note 941594|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=0000941594&nlang=E]
    Good luck!
    Regards,
    Aditya

  • It’s compatible OWB 9.0.4.10 with W2003 and Oracle 10.2.0.1?

    I have to migrate a DWH on Server 1 (OWB 9.0.4.10, Oracle Workflow 2.6.2, Windows 2000, Oracle 9.2.0.6) to Server 2 1 (OWB 9.0.4.10, Oracle Workflow 2.6.3, Windows 2003, Oracle 10.2.0.1)
    It’s posible to use OWB 9.0.4.10 with W2003 and Oracle 10.2.0.1?
    Thanks very much in advance!

    Hi,
    This is the relevant section from Metalink's 'Certify' section:
    Server Certifications
    Product      Server      Status      Addtl. Info.      Components      Other      Issues
    10.1.0.x      9.2.0.x      Certified      None      None      Yes      None
    10.1.0.x      8.1.7 (8i)      Desup:RDBMS      None      None      N/A      N/A
    10.1.0.x      10.2.0.x      Certified      Yes      None      Yes      None
    10.1.0.x      10.1.0.x      Certified      None      None      Yes      None
    Additional info on 10gR2 DB: Database 10.2.0.x is only certifed with Oracle Warehouse builder patch set 10.1.0.4 or higher.
    So: bad luck, need to upgrade OWB 10.1.0.4 to at least.
    I suggest you learn to use Metalink for having these kinda questions answered.
    Good luck,
    Erik Ykema

  • Creating model with Control and Design LV2009

    Hello,
    I'm trying to make a PI control model with Control and Design in labview 2009. I'm tyring to create the following transferfunction:
    D(z)=Kp+((Kp*Ki)/(1-z^-1))
    But labview adds by itself an extra z^-1 in the Numerator
    See the attachment what I have tried. I first want to create 1+(1/(1-z^-1)). What I'm I doing wrong ?
    Greetz,
    Jeroen
    Attachments:
    model.jpg ‏50 KB

    Jeroen,
    The two expressions "1+(1/(1-z^-1))" and "(2-z^-1)/(1-z^-1)" are equivalent to one another.  They just have the terms rearranged.  Since LabVIEW expresses a transfer function as a numerator and denominator, it is drawing the function as "(2-z^-1)/(1-z^-1)".  You aren't doing anything wrong.
    Chris M 

  • Help with VB6 and Oracle Spatial

    Does anyone knows how to access to the Geoloc field of an oracle 8.16 table using VB6?
    I need to read/write it but Ado doesn't like very much that dataType...
    I'm triyng with ADO and oracle's oraOleDB, but i'll appreciate any other working solution.
    Thank You.
    Daniela.
    null

    We have written a stored procedure(Procedure) in Oracle to update the data type fields that are unavailable in ADO calling the procedure using ADO from VB.
    Dinghy, how much of a learning curve is it to go from ADO to OO4O (Oracle Object for OLE)?
    Thanks,
    Thomas L
    null

  • Discussion Forum Portlet - Problems with JAVA and UTF8?

    Hi
    I installed the Discussion Forum Portlet successfully. It also seems that almost everything works fine. There's only a problem if I have new posts that include special German characters (Umlaute) like ä, ö, ü or special French characters like é, è or ç. They are saved correctly in the table but if you view the post the characters are not displayed correctly.
    Example
    input: ça va?
    result: ça va?
    I know that there are problems with Java and UTF8 Database. Is there a possibility to change this (bug)?
    Regards
    Mark

    Here's what I got. I don't see anything that helps but I'm kinda new to using SQL and java together.
    D:\javatemp\viddb>java videodb
    Problem with SQL java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver
    ] Syntax error in CREATE TABLE statement.
    Driver Error Number-3551
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in
    CREATE TABLE statement.
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source)
    at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source)
    at videodb.main(videodb.java:31)
    D:\javatemp\viddb>

Maybe you are looking for

  • 10g installation error on RHEL4

    Hi all I am installing 10g 10.2.01 on RHEL 4 I got error [oracle@vtopup oracle10g]$ ./runInstaller Starting Oracle Universal Installer... Checking installer requirements... Checking operating system version: must be redhat-3, SuSE-9, redhat-4, United

  • How to find KPI used in which query

    Hi All , I have around 10 KPI's. I want to know in which queries these KPI's are used. How can I check that ? Thanks Prateek

  • Capturing ENTER key in WD4A

    Hi all, I m getting an input from the user in an Inputfield. I also have a table with two columns. The textfield is used to perform wildcard search (filter) for the table. That is, if i give a character like 'A', then the records which start with the

  • Uploading/downloading a file to database

    Hello friends, I have created a page into which there is a button names "Upload Resume". The idea is when an HR person clicks this button it should fetch out the resume from his local machine and it save resume into the database. My doubts are as fol

  • I need details about how bindings work

    Hi All, I am having trouble figuring out when a binding ends. What I am doing is putting a reference to an object in the the request such as following.     TheObject theObjectInstance= new TheObject();     request.setAttribute("theObjectInstanceName"