Use persistEntity problem

Dear all:
I hava dropped a constructor and a persistEntity from the Data controls palette ,to insert a record ,and in this table has a column which type is number(6,2), when i run the project and click the persistEntity button,errors diplay as follows:
JBO-29000: Unexpected exception caught: java.lang.IllegalArgumentException, msg=argument type mismatch,
and the af:inputText's value is number(10.00 or 10),why is that?
Thanks

Thanks for you help and it runs well!
but i am confused about when i use ${bindings.VsaMirOfferInfo.result} ,except the double type column has problem, other type columns(e.g:Intger String) are good.
Alex

Similar Messages

  • My iMac 27" Late 2012 has Image Persistence Problem

    I'm wondering what to do about an annoying image persistence problem on my 27" late 2012 iMac. I got the iMac just a few days ago. Monday actually, so 4 days ago.
    It's the 3.4GHz i7, 8GB, NVIDIA 680MX 1TB fusion drive model.
    Overall it has become the love of my life, but the image persistence thing is getting harder to ignore. This happens after only a few minutes of use. If I follow Apple's instruction on dealing with LCD image persistence, I can make it go away for a while, but it comes back very quickly.
    It is extremely noticeable on a plan dark background. It looks as thought he screen has been left on for a very long time with the same windows open, but it occurrs in less than 5 minutes of use with nothing more intense than a bit of web surfing.
    I've read that this is happening a great deal on these new iMacs, particularly teh 27" machines.
    While the problem seems to be known to those of us afflicted I don't know if Apple has acknowledged an issue or not.
    Here is a sample of the complaints: http://forums.macrumors.com/showthread.php?t=1509571
    I can make the ghost image vanish by bringing up an all white scree for a minute or so or using LCD Scrub.
    I'm wondering if anyone else has foun a solution other than asking for a replacement computer, which Apple seems to be granting on this issue?

    Avoiding image persistence on Apple (IPS) displays
    Avoiding image persistence on Apple LCD displays
    If you cannot resolve the issue yourself, then return the computer for a replacement. You may do this freely within 14 days from date of purchase, so don't delay.

  • Saving and Restoring a class using Persistence Delegate

    Hi, I have a class that does not comply to the java bean format and thus I have decided to use persistence delegates. All I want to do is be able to save an entire class so I can restore it later.
    So this is what I did:
    XMLEncoder xe = new XMLEncoder(
    new BufferedOutputStream(
    new FileOutputStream(filename)));
    xe.setPersistenceDelegate(Workspace.class,
    new PersistenceDelegate()
    protected Expression instantiate(Object oldInstance, Encoder out)
    return new Expression(oldInstance, oldInstance.getClass(),
    "new", new Object[]
    oldInstance,
    oldInstance,
    oldInstance,
    oldInstance,
    oldInstance,
    oldInstance,
    oldInstance,
    oldInstance
    xe.writeObject(workspace);
    xe.close();
    Where workspace takes in a BufferedImage, int, int, int, int, int, String and String.
    The workspace class Vectors and an array of another class of mine.
    When I run this code I get : java.lang.StackOverflowError
    Can someone point me in the right direction please?
    Thanks in advance,
    Harley.

    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.

  • [svn] 1313: Fix for the use namespace problems we've been having with ASC ( I hope).

    Revision: 1313
    Author: [email protected]
    Date: 2008-04-20 09:41:41 -0700 (Sun, 20 Apr 2008)
    Log Message:
    Fix for the use namespace problems we've been having with ASC (I hope). The problem was that the use directive was being defined after we had called finish package. The UseDirectiveNode has a pkgdef ptr, and does different things depending if that ptr is null or not. It should not be null when the UseDirective is inside the package - but since we were generating the UseDirectiveNode after we had called finishPackage the UseDirectiveNode didn't have it's pkgdef ptr set, and so things went awry as the package didn't get set up with all the correct open namespaces. I haven't tested this in authoring/flex but I am pretty sure that this will fix all the problems we're seeing.
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/Parser.java

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • Why use Persistence

    I used to get confused why should we use persistence. If we store Objects in a persistent medium and the actual data got changed in the actual back end (not persistent medium) meanwhile by another process how do we use the stale OBJECT that is there in the persistent medium is used. Please help me to understand this process.

    Well there are lots of times I'd want to save a whole object. to use later on.
    Right now I'm writing a batch processing framework for some nice people and as I'm writing this framework I have to allow for rerunning failed job and what not. However, I have no idea who's going to be using my framework or what types of batch jobs they are going ot be doing.
    In order to facilitate restarting a job I let them save an object (whatever they want as long as it's serializable) by calling my "saveForRestart(Object o) method.
    So I take their nice object they've made for me and I save it to a DB blob (not really a blob) for them and then if they need to restart the job at some future point they can call getStateForRestart and I give them their nice object back and they're off and running their batch job right where they left off.
    Hibernate is a great great tool if you know how to use it correctly, if you don't it can be a complete disaster.

  • Last update to ios6 - worst ever, facetime does not work as it used to, problems with skype

    last update to ios6 - worst ever, facetime does not work as it used to, problems with skype, losing connection or no9t connecting facetime to face time. Do something with it.

    I'm not sure yet, but It may be as simple as "settings", "FaceTime" "Off"

  • Persistence problems wit seam/hibernate and EntityHome

    This is the scenario(using JBoss Seam 2.2 and JBoss Application Server 5.1.0.):
    I've got TestCases and TestSteps. One TestCase has multiple TestSteps. I have a table that displays the steps and actions like "addStep" and "deleteStep".
    I use rich:inplaceInput to edit existing steps. This works perfectly.
    Adding or deleting a step however does not. When adding, I create an "empty" step which is displayed in the table and the user can then edit it.
    I can't explain how it persists changes to existing steps, but doesn't cooperate when list TestCaseHome.testSteps changes in size.
    Entity TestStep:
    @Entity
    @Table(name = "teststeps")
    public class TestStep implements java.io.Serializable {
         private static final long serialVersionUID = 6534546556882292702L;
         private long id;
         private TestCase testCase;
         private String test;
         private String expectedResult;
         private long ordering;
         @ManyToOne(fetch = FetchType.LAZY)
         @JoinColumn(name = "tc_id")
         public TestCase getTestCase() {
              return this.testCase;
         public void setTestCase(TestCase testCase) {
              this.testCase = testCase;
    }Entity TestCase: Entity CoreTestObject isn't really relevant, TestCase just inherits it's id from it.
    @Entity
    @Table(name = "testcases")
    @PrimaryKeyJoinColumn(name="id")
    public class TestCase extends CoreTestObject implements java.io.Serializable{     
         private Set<TestStep> testSteps = new HashSet<TestStep>(0);
         public TestCase(Set<TestStep> testSteps, ...) {
              this.testSteps = testSteps;
         @OneToMany(fetch = FetchType.LAZY, mappedBy = "testCase")
         @OrderBy("test")
         public Set<TestStep> getTestSteps() {
              return this.testSteps;
         public void setTestSteps(Set<TestStep> testSteps) {
              this.testSteps = testSteps;
    }TestCaseHome:
    @Name("testCaseHome")
    @Scope(ScopeType.CONVERSATION)
    public class TestCaseHome extends EntityHome<TestCase> {     
         @DataModel
         private List<TestStep> testSteps;
         /*@param step The Step after which the new Step is to be inserted*/
         public void addStep(TestStep step){
              testSteps = new ArrayList<TestStep>(this.getInstance().getTestSteps());
              long id, ordering;
              [...] // here I find the id and ordering of step
              testSteps.add(new TestStep(id+1, this.getInstance(), "", "", ordering+1));     
              this.getInstance().setTestSteps(new HashSet<TestStep>(testSteps));
         /*@param step The Step to be deleted*/
         public void deleteStep(TestStep step){
              int index = testSteps.indexOf(step);          
              testSteps.remove(index);
              this.getInstance().setTestSteps(new HashSet<TestStep>(testSteps));          
    }EntityHome:
    public class EntityHome<E> extends Home<EntityManager, E>
       @Transactional
       public String update()
          joinTransaction();
          getEntityManager().flush();
          updatedMessage();
          raiseAfterTransactionSuccessEvent();
          return "updated";
       @Transactional
       public String persist()
          getEntityManager().persist( getInstance() );
          getEntityManager().flush();
          assignId( PersistenceProvider.instance().getId( getInstance(), getEntityManager() ) );
          createdMessage();
          raiseAfterTransactionSuccessEvent();
          return "persisted";
    }View:
    <rich:dataTable value="#{testCaseHome.testSteps}" var="_testStep"
              id="testStepsTable" rowKeyVar="row" autoresize="true">
         <rich:column sortBy="#{_testStep.ordering}"
              sortOrder="ASCENDING" style=" width : 20px;">
              <f:facet name="header">Order</f:facet>
              <rich:inplaceInput layout="block" value="#{_testStep.ordering}"
                   selectOnEdit="true" editEvent="onclick">
                   <a:support event="onviewactivated" ajaxSingle="true"
                        reRender="testStepsTable" />
              </rich:inplaceInput>
         </rich:column>
         <rich:column sortBy="#{_testStep.expectedResult}" [...] </rich:column>     
         <rich:column sortBy="#{_testStep.test}"> [...] </rich:column>
         <rich:column style=" width : 80px;">
              <f:facet name="header">
                   Action
                        </f:facet>
              <a:commandLink ajaxSingle="true" id="deletelink"
                   reRender="testStepsTable"
                   action="#{testCaseHome.deleteStep(_testStep)}">
                   <h:graphicImage value="/img/delete.gif" />
                   <f:param name="testCaseId" value="#{testCaseHome.instance.id}" />
                   <f:param name="testStepFrom" value="TestCase" />
              </a:commandLink>
              <a:commandLink ajaxSingle="true" id="addlink"
                   reRender="testStepsTable"
                   action="#{testCaseHome.addStep(_testStep)}">
                   <h:graphicImage value="/img/plus_icon.gif" style=" width : 16px; height : 16px;"/>
                   <f:param name="testCaseId" value="#{testCaseHome.instance.id}" />
                   <f:param name="testStepFrom" value="TestCase" />
                   <s:conversationId />     <!-- <<<<I thought that might help but it didn't-->
              </a:commandLink>
         </rich:column>
    </rich:dataTable>
    <div class="actionButtons">
         <h:commandButton id="save"
              value="Save" action="#{testCaseHome.persist}"
              disabled="#{!testCaseHome.wired}"
              rendered="#{!testCaseHome.managed}" />
         <h:commandButton id="update"
              value="Save" action="#{testCaseHome.update}"
              rendered="#{testCaseHome.managed}" />
    </div>I cut a lot from the code, I hope I didn't leave anything relevant out. I also hope this is the right place for this question, excuse me if not (noob here).
    I would very much appreciate your help since I'm trying to fix this for weeks. Thank you!

    Hello gimbal2,
    yes, I initialized the collection by myself now and it works better.
    But I think there is a general Problem in the order-Example. The Example isn't implemented as described in the written part of the tutorial and has several other
    bugs with persistence in this example.
    I've installed the turorial with Update Tool. Is it possible that the samples in the update contain a newer/older version than the code that is described in the PDF?
    Thanks,
    Johann

  • Persistence problems

    Hello. I have made myself a web app using Java Server Faces which I am running on Glass Fish V2.
    The problem that I am having is that while the program complies and runs without throwing any exceptions. My entities are not beeing saved to the database when I call the persist() method on them. The primary key of the entity objects (which is set to auto generate) is updated after the call to persist(), and the sequence database table is also updated. But no data is entered in to the database table for the entity object.
    My app reads data from the database that I have inserted via SQL commands by running Queries made in the Java persistencve query lanuage and returns entity objects as you would expect.
    Here is the entity object I am trying to save.
    @Entity
    @NamedQueries({
    @NamedQuery(name="getTimeSheetsBetween",
                query="Select ts From TimeSheet ts Where ts.startDate >= :startDate AND ts.endDate <= :endDate"),
    @NamedQuery(name="getTimeSheetsFor",
                query="Select ts From TimeSheet ts Where ts.timeSheetUser = :user")})
    public class TimeSheet implements Serializable {
        private static final long serialVersionUID = 1L;
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
        @ManyToOne
        private TimeSheetUser timeSheetUser;
        @Temporal(TemporalType.DATE)
        private Date startDate;
        @Temporal(TemporalType.DATE)
        private Date endDate;
        private boolean signedOff;
        @OneToMany(cascade=CascadeType.ALL)
        private List<TimeSheetDay> timeSheetDays;
        public TimeSheet(){
        public TimeSheet(TimeSheetUser pUser, Calendar pStartDate, Calendar pSettingsStartDate, int pLength){
            Calendar testEndDate = (GregorianCalendar) pSettingsStartDate.clone();//modifications to objects passed as method parameters are not reverted after the method is finished
            Calendar testStartDate = (GregorianCalendar) pSettingsStartDate.clone();//so we create new date values to change which will not effect the pSettingsStartDate object
            testEndDate.add(Calendar.DAY_OF_MONTH, pLength);
            while(!(pStartDate.after(testStartDate) && pStartDate.before(testEndDate))){
                testStartDate.add(Calendar.DAY_OF_MONTH, pLength);
                testEndDate.add(Calendar.DAY_OF_MONTH, pLength);
            }//not sure if this is the best way to work this out. Refacter later
            startDate = testStartDate.getTime();
            endDate = testEndDate.getTime();
            signedOff = false;
            timeSheetUser = pUser;
            timeSheetDays = new ArrayList(pLength);
            for(int counter = 1; counter <= pLength; counter++){
                TimeSheetDay day = new TimeSheetDay(testStartDate.getTime());
                timeSheetDays.add(day);
                testStartDate.add(Calendar.DATE, 1);
        Here is the method that saves data
    package timesheet2;
    import java.io.Serializable;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.persistence.EntityExistsException;
    import javax.persistence.EntityManager;
    import javax.persistence.Query;
    import javax.persistence.EntityManagerFactory;
    import javax.persistence.Persistence;
    import javax.persistence.PersistenceUnit;
    import javax.persistence.TransactionRequiredException;
    import timesheet2.entities.PayPeriodSettings;
    import timesheet2.entities.TimeSheet;
    import timesheet2.entities.TimeSheetUser;
    import timesheet2.exceptions.*;
    public class DataBaseAccess implements Serializable{
        private static final Logger logger = Logger.getLogger("timeSheet.DataBaseAccess");
        private List<PayPeriodSettings> periodSettings;
        private TimeSheetUser currentUser;
        @PersistenceUnit
        private EntityManagerFactory emf;
        public DataBaseAccess() throws Exception{
            logger.log(Level.INFO, "DBAO being created, timeSheet.DataBaseAccess");
                try{
                    emf = Persistence.createEntityManagerFactory("TimeSheet2PU"); //emf is not injected into the object, don't know why.
                catch(Exception e){
                    System.out.println("there was a problem with making the em " + e.getMessage());
        public TimeSheet getTimeSheet(TimeSheetUser pUser, Date pDate)throws NoPeriodSettingsFound, UserNotFound{
            EntityManager em;
            List<TimeSheet> userTimeSheets = pUser.getTimeSheets();    
            for(TimeSheet ts : userTimeSheets){           
                if(pDate.after(ts.getStartDate()) && pDate.before(ts.getEndDate())) return ts;
            //if we get this far the user does not have a time sheet that covers the given date
            Calendar date = new GregorianCalendar();
            date.setTime(pDate);
            PayPeriodSettings settings = getPayPeriodSettings(date);
            TimeSheet timeSheet = new TimeSheet(pUser, date, settings.getSettingsStartDate(), settings.getPeriodLength());
            try{
                em = emf.createEntityManager();
                System.out.println("Time sheet id = " + timeSheet.getId());
                em.persist(timeSheet);
                System.out.println("Time sheet id = " + timeSheet.getId()); //id is updated at this time.
            catch(EntityExistsException e){
                System.out.println("EntityExistsException with persist method call. " + e.getMessage());
            catch(IllegalStateException ise){
                System.out.println("IllegalStateException with persist method call. " + ise.getMessage());
            catch(IllegalArgumentException iae){
                System.out.println("IllegalArgumentException with persist method call. " + iae.getMessage());
            catch(TransactionRequiredException tre){
                System.out.println("TransactionRequiredException with persist method call. " + tre.getMessage());
            catch(Exception e){
                logger.log(Level.INFO,"Exception: DateBaseAccess.getTimeSheet", e);
            pUser.addTimeSheet(timeSheet);
            return timeSheet;
        }

    Hi,
    We are using JDeveloper 11.1.1.6. We have enabled the MDS on this setup.
    Though its working fine with all the defined components , its not working for af:panelsplitter.
    Can you please update if MDS is working fine with af:panelsplitter in JDeveloper 11.1.1.6?

  • * newbie alert * kodo persistence problem

    Trying to follow this oh so easy example:
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/JDev11gExperience/JDev11gExperience.html
    Here's the last few lines of the exception error...
    The following providers:
    kodo.persistence.PersistenceProviderImpl
    org.apache.openjpa.persistence.PersistenceProviderImpl
    Returned null to createEntityManagerFactory.
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:154)
         at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
         at sample.model.JavaServiceFacade.<init>(JavaServiceFacade.java:12)
         at sample.model.JavaServiceFacade.main(JavaServiceFacade.java:19)
    Process exited with exit code 1.
    Connecting through an JDBC-ODBC bridge to an Ingres database (other locking issues make it difficult to connect using native ODBC driver)
    fairly simple logic... connect to a single table then display one field out of the table to the console
    [Tuserprof.java]
    @Entity
    @NamedQueries({
    @NamedQuery(name = "TUserprof.findAll", query = "select o from TUserprof o")
    [JavaServiceFacade.java]
    public static void main(String [] args) {
    final JavaServiceFacade javaServiceFacade;
    javaServiceFacade = new JavaServiceFacade();
    // TODO: Call methods on javaServiceFacade here...
    List<TUserprof> emps = javaServiceFacade.getTUserprofFindAll();
    for (TUserprof tUserprof : emps) {
    System.out.println(tUserprof.getFirst_name());
    Here's the persistence.xml file
    <?xml version="1.0" encoding="windows-1252" ?>
    - <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
    - <persistence-unit name="Model-1" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>sample.model.TUserprof</class>
    - <properties>
    <property name="eclipselink.jdbc.driver" value="sun.jdbc.odbc.JdbcOdbcDriver" />
    <property name="eclipselink.jdbc.url" value="jdbc:odbc:sys10 sql" />
    <property name="eclipselink.jdbc.user" value="report" />
    <property name="eclipselink.jdbc.password" value="C21EECE0FBC5CC41A77C390BE52548ED" />
    <property name="eclipselink.logging.level" value="FINER" />
    <property name="eclipselink.target-server" value="WebLogic_10" />
    </properties>
    </persistence-unit>
    - <persistence-unit name="Model">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:/app/jdbc/jdbc/sys10sqlDS</jta-data-source>
    <class>sample.model.TUserprof</class>
    - <properties>
    <property name="eclipselink.target-server" value="WebLogic_10" />
    <property name="javax.persistence.jtaDataSource" value="java:/app/jdbc/jdbc/sys10sqlDS" />
    </properties>
    </persistence-unit>
    </persistence>
    NO CLUE on how to solve the error... any assistance would be appreciated...
    Edited by: shawnc on Mar 14, 2011 2:58 PM

    NO CLUE on how to solve the errorFirst step STOP using a JEE server to figure out the problem.
    Write a simple Java console app to test your ODBC set up. If you can't get that to work then you can't get it to work in JEE.

  • Viewing Excel Files using Tomcat - Problem with caching

    Hi all,
    A small part of an application I'm writing has links to Excel files for users to view/download. I'm currently using Tomcat v5 as the web/app server and have some very simple code (an example is shown below) which calls the excel file.
    <%@ page contentType = "application/vnd.ms-excel" %>
    <%
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
    response.sendRedirect("file1.xls");
    %>
    This all works except but I'm having one big problem.
    The xls file (file1.xls) is updated via a share on the server so each month, the xls file is overwritten with the same name but with different contents. I'm finding that when an update is made to the xls file and the user then attempts to view the new file in the browser they recieve only the old xls file. It's caching the xls file and I don't want it to. How can I fix this so that it automatically gives the user the new updated file.
    The only way I've managed to get Tomcat to do this is to delete the work directory and delete the file from my IE temp folder and then restart Tomcat - this is a bit much!
    Any help would be greatly appreciated.
    Thanks.

    I'd a problem with caching a few years back, for a servlet request which returned an SVG file.
    As a workaround, I ended up putting appending "#" and a timestamp / random number after it. The browser assuming each request was new, and didn't use the cache.
    Eg.
    http://myserver/returnSVG.do#1234567
    where 1234567 is a timestamp / random.
    Not sure whether you can do this on a file based URL... but maybe worth a shot...
    regards,
    Owen

  • Mildet connect to oracle DB using servlet problem ,help please

    hi guys i have a problem am tring to connect my midlet to databse through midlet but i don`t know what is the problem so far the midlet already connect to my servlet url but the servlet cant read the parameters to open the connection for database
    my servlet code
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.text.*;
    * @author freddy
    public class getconnection extends HttpServlet {
        Statement statement;
    ResultSet rs=null;
    String bstr=null;
    String bstr1=null;
    String bstr2=null;
    public void init()
        * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
        * @param request servlet request
        * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            PrintWriter out = response.getWriter();
            try {
                /* TODO output your page here
                out.println("<html>");
                out.println("<head>");
                out.println("<title>Servlet getConnection</title>"); 
                out.println("</head>");
                out.println("<body>");
                out.println("<h1>Servlet getConnection at " + request.getContextPath () + "</h1>");
                out.println("</body>");
                out.println("</html>");
            } finally {
                out.close();
        // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
        * Handles the HTTP <code>GET</code> method.
        * @param request servlet request
        * @param response servlet response
        @Override
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
      doPost(request,response);
        * Handles the HTTP <code>POST</code> method.
        * @param request servlet request
        * @param response servlet response
        @Override
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
            DataInputStream in = new DataInputStream(
                    (InputStream)request.getInputStream());
            String sid = in.readUTF();
            String user = in.readUTF();
            String pwd = in.readUTF();
          //  "jdbc:oracle:thin:@localhost:1521"+": "+sid
            String message = message = "Name:"+bstr+" telephone:"+bstr1+" burthday:"+bstr2;
             try {
                connect(sid,user, pwd);
                message += "100 ok connected";
            } catch (Throwable t) {
                message += "200 " + t.toString();
            response.setContentType("text/plain");
            response.setContentLength(message.length());
            PrintWriter out = response.getWriter();
            out.println(message);
            in.close();
            out.close();
            out.flush();
        private void connect(String sid, String user,String pwd)
        throws Exception {
            // Establish a JDBC connection to the MYSQL database server.
            //Class.forName("org.gjt.mm.mysql.Driver");
            Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
            Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:"+sid,user,pwd);
            System.out.print("connected");
            try{
               statement =conn.createStatement();
                rs=statement.executeQuery(" Select*from WOH.P_DEMGRAPHICS where P_ID='P1000 '");
            catch(SQLException e)
            System.err.print(e);
           try{
    while (rs.next()) {
    bstr=rs.getString(2);
    bstr1=rs.getString(3);
    bstr2=rs.getString(4);
    statement.close();
       catch (SQLException e) {
    //bstr += e.toString();
    System.err.println(e);
    System.exit(1);
            // Establish a JDBC connection to the Oracle database server.
            //DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
            //Connection conn = DriverManager.getConnection(
            //      "jdbc:oracle:thin:@localhost:1521:"+db,user,pwd);
            // Establish a JDBC connection to the SQL database server.
            //Class.forName("net.sourceforge.jtds.jdbc.Driver");
            //Connection conn = DriverManager.getConnection(
            //      "jdbc:jtds:sqlserver://localhost:1433/"+db,user,pwd);
        * Returns a short description of the servlet.
        public String getServletInfo() {
            return "Short description";
        // </editor-fold>
    }Midlet code
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.util.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    * @author freddy
    public class testOrcl extends MIDlet  implements CommandListener {
       protected String url;
        private String username;
        private Display display;
        private Command exit = new Command("EXIT", Command.EXIT, 1);;
        private Command connect = new Command("Connect", Command.SCREEN, 1);
        private TextField tb;
        private Form menu;
        private TextField tb1;
        private TextField tb2;
        DB db;
        public testOrcl() throws Exception
            display=Display.getDisplay(this);
            url="http://localhost:8084/getConnection/getconnection";
        public void startApp() {
            displayMenu();
        public void displayMenu()
        menu= new Form("connect");
         tb = new TextField("Please input database: ","",30,
                    TextField.ANY );
            tb1 = new TextField("Please input username: ","",30,
                    TextField.ANY);
            tb2 = new TextField("Please input password: ","",30,
                    TextField.PASSWORD);
            menu.append(tb);
            menu.append(tb1);
            menu.append(tb2);
            menu.addCommand(exit);
            menu.addCommand(connect);
            menu.setCommandListener(this);
            display.setCurrent(menu);
        public void pauseApp() {
        public void destroyApp(boolean unconditional) { }
        public void commandAction(Command command, Displayable screen) {
            if (command == exit) {
                destroyApp(false);
                notifyDestroyed();
            } else if (command == connect) {
                db  = new DB(this);
                db.start();
                db.connectDb(tb.getString(),tb1.getString(),tb2.getString());
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    import java.io.*;
    import java.util.*;
    import javax.microedition.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.lang.*;
    * @author freddy
    public class DB implements Runnable  {
        testOrcl midlet;
         private Display display;
            String sid;
            String user;
            String pwd;
            public DB( testOrcl midlet)
            this.midlet=midlet;
            display=Display.getDisplay(midlet);
        public void start()
        Thread t = new Thread(this);
                t.start();
        public void run()
         StringBuffer sb = new StringBuffer();
                try {
                    HttpConnection c = (HttpConnection) Connector.open(midlet.url);
                   c.setRequestProperty(
                       "User-Agent","Profile/MIDP-2.1, Configuration/CLDC-1.1");
                    c.setRequestProperty("Content-Language","en-US");
                    c.setRequestMethod(HttpConnection.POST);
                    DataOutputStream os =
                            (DataOutputStream)c.openDataOutputStream();
                    os.writeUTF(sid.trim());
                    os.writeUTF(user.trim());
                    os.writeUTF(pwd.trim());
                    os.flush();
                    os.close();
                    // Get the response from the servlet page.
                    DataInputStream is =(DataInputStream)c.openDataInputStream();
                    //is = c.openInputStream();
                    int ch;
                    sb = new StringBuffer();
                    while ((ch = is.read()) != -1) {
                        sb.append((char)ch);
               showAlert(sb.toString());
                    is.close();
                    c.close();
                } catch (Exception e) {
                    showAlert(e.getMessage());
         /* This method takes input from user like db,user and pwd and pass
                to servlet */
            public void connectDb(String sid,String user,String pwd) {
                this.sid = sid;
                this.user = user;
                this.pwd = pwd;
            /* Display Error On screen*/
            private void showAlert(String err) {
                Alert a = new Alert("");
                a.setString(err);
                a.setTimeout(Alert.FOREVER);
                display.setCurrent(a);
       

    Comment out process request or rewrite & move it to a position after you read the parameters and connect to the db. Decide where you want to write to the output stream. Also, you have some superfluous casting.
    I take it that you are using netbeans? If you debug and step through the code you will get an idea of the flow. The steps should be, midlet connects with POST, doPost is called, server reads parameters, server opens connection, executes query, releases/closes connection, and writes a response to the midlet.
    Some notes about the connect method; The scope of rs may cause problems. It is unlike you will have a valid result set if you have a problem with create statement or execute. Take a look at connection pooling and be mindful how the connections are opened, used, and closed; put all the important cleanup operations in a finally. Remove system.exit from your servlet. Actually I would suggest limiting the scope of all your vars;
    If you store the username, password, and sid on the midlet, you may have trouble updating the installation base if you need to change the values for any reason. Also, you have clients which contain your database u/p, susceptible to snooping and decompilation. Use the servlet to abstract the db from the client. And use a datasource (with connection pooling) for obtaining connections to db.

  • Macbook pro retina, too much ram used & performance problems

    i've recently got my macbook pro with retina display, 128 gb i5 intel 2.6Hz processor with 8gb memory, OS Yosemite 10.10.1. problems began to appear the very first moment i've turned it on: at the last step of profile creation (the step where you choose a name and a password of your profile), after i've filled all the fields and clicked some button to proceed, my macbook refused to boot and froze. i've restarted the computer and then it booted just fine. Then new problems appeared: after installing some apps from mac app store, they wouldn't load the first time i open them, - i had to close them and reopen. Once again, this issue wasn't appearing with every app - only with a few ones. I assumed that this was a software issue which will disappear after i update. And well, i didn't observe this problem ever since i've updated the OS. However, i can't be sure that it disappeared.
    Also, i monitor RAM consumption using the Memory Clean app. there are like only 3.60 gb free space out of 8. is it ok?
    so, what i am asking: should i take my macbook to a store to get it fixed or this problem is just a software and not a hardware issue and i just have to wait?
    Thanks

    @_Macuser wrote:
    Also, i monitor RAM consumption using the Memory Clean app. there are like only 3.60 gb free space out of 8. is it ok?
    That is normal.  The Mavericks and Yosemite OSXs use as much RAM as is available in order to increase efficiency.. The parameter that you should monitor is 'pressure', not the amount.  If it is GREEN, you are operating within acceptable limits.  If there is a color change, then more RAM may be required or there may be other issues that may need attention.
    so, what i am asking: should i take my macbook to a store to get it fixed or this problem is just a software and not a hardware issue and i just have to wait?
    Since you have a new MBP, your best option is an appointment at an Apple store genius bar and have them sort out the issues for you.  Your MBP has a warranty, use it.
    Ciao.

  • HT5455 image persistence problem on Macbook Pro Retina 15"

    Is it a faulty or normal behaviour if we see an image persistence after 5 minutes ( less than 15 minutes "Default setting of Energy Saver while using Power Adapter" to sleep/ turn off the display of Macbook Pro Retina 15 inch)?
    Today, the Technical support checked my screen using the gray.html and it did not appear. And She said it is a normal behaviour to have an image persistence, because the retina bla bla bla (i don't remember exactly) and just dont leave the laptop too long.
    http://r238.local/display/gray.html
    Just now after playing a Chess (appx 30 minutes) , and run that test. The image persistence appeared and I guess I need to make appointment again..
    Any solution and suggestion?
    or We will stick with what the technical support said "Normal Behaviour" ?

    The warranty entitles you to complimentary phone support for the first 90 days of ownership.
    If you bought the product in the U.S. directly from Apple (not from a reseller), you have 14 days from the date of delivery in which to exchange or return it for a refund. In other countries, the return policy may be different. If you bought from a reseller, its return policy applies.

  • I have been trying to find a way of contacting you by e-mail so that I can write to you about a problem I have. Could you please give me an e-mail address to use for problems or refunds from i-tunes? Many thanks

    I have been trying to find an e-mail address for Apple problems that are not on your list of questions usually asked. Could you therefore let me have an e-mail address for being able to sort a problem I have with i-tunes purchasing for audo books as I by mistake downloaded a book instead of an audio book and would like a refund for The One I Love by Paul Pilkington so that I can download the audio book. This is the first time that I have used this facility and I obviously got confused with books and audio books, I need audio books because I have an I Pod Nano and I like to listen to my books on this. Look forward to your reply.
    Regards, Sandra

    Sandra,
    See this Apple support document for information on reporting an issue with your iTunes purchase.
    http://support.apple.com/kb/HT1933
    B-rock

  • Is there a solution for my "files in use" installation problem with Adobe Reader XI?

    I have tried repeatedly to download Adobe Reader XI (11.0.07), but I keep getting a "files in use" message that indicates my current version, Adobe Reader 8.1, is using files that need to be updated by the download's set up. The message directs me to close my Adobe Reader 8.1 and then continue, but when I receive it my Adobe Reader 8.1 is always closed. I am tempted to uninstall my Reader 8.1 and then try downloading Reader XI, but I am afraid I could be inviting even more trouble. I should mention the reason I am trying to download Reader XI is a notification I received in my computer's status box that indicates my Reader 8.1 is not working properly and suggests I download the latest version. I discovered the notification after I was unable to open a GIF file attachment. Does anyone have a solution for this problem?

    Thanks for your reply.
    I tried to uninstall my Adobe Reader 8.1 in safe mode, as suggested above, but received a message which indicated that Windows installer could not be accessed. That was a strange message, because I have not had problems uninstalling programs in the past, and, after receiving the message, I tried uninstalling a different program in safe mode and had no problem doing so. I am now going to try your suggestion.
    Honestly, these types of technical issues always leave me so frustrated. I do not have a high technology acumen, and because my laptop is six years old, I cannot get professional help without paying a hefty fee. Thank goodness for this forum. If the solutions suggested here do not work, I guess I will keep my laptop until my Adobe 8.1 gives out completely.
    Thanks again for your assistance. I will let you know if it works.

Maybe you are looking for

  • Error in uploading the PO while running Direct Input porgram RM06EEI0

    Hi all i have written one conversion program to upload PO. Here in the program i am populating the batch input structures MBEPOH and MBEPOI and finally writing it to the unix file. Finally when i execute the direct input program RM06EEI0 using the lo

  • Questions on URLs and dynamic navigation rules

    Hello, I am new to JSF, so any help is appreciated. I am trying to do the following: Dynamic display URI - users submit multiple parameters for a search. The URL needs to change depending on search parameters they submit. For example, if they search

  • Transferring lots of small files to a USB - not enough space when there is!

    I regularly transfer about 200-250 files (photos of about 1.2MB each) to a USB (size 2GB). I really want to just "Select All" then drag them onto the USB, but if I do this, I get the error message that there is not enough space. I end up having to se

  • Upgrade CUCM 9.1 (BE6K) to CUCM 10.5

    Hi All, We are facing the process to update CUCM and I&M on a BE6K platform from 9.1 version to the latest one (CUCM 10.5), The UCSS is still valid. Could someone put us on the right direction? Is Expressway Core and Edge already included if my CUCM

  • Automatic generation of Quality notification of type Q1 and/or F1

    Hi, Can anybody give me the steps to generate F1 and/or Q1 quality notifications automatically. Please give me detailed process which should i fallow to achieve this. Thanks in advance. Anand K