Visualizzare lo stato ingressi con led boolean

Sono alle prime esperienze con Labview e una 6009 in particolare sto facendo prove con I/O digitali ed il loro controllo, per le uscite mediante pulsanti e la funzione build array ho creato un array e inviandolo all'ingresso data del daq assistant opportunamente impostato sono riuscito a pilotare le uscite.
Per quanto riguarda gli ingressi volevo visualizzare il loro stato mediante dei led sul pannello frontale, dopo aver configurato il daq assistant  in digital line input dall'uscita data come posso indirizzare i segnali provenienti deli ingressi verso i led boolean?
Scusate per la banalità della domanda!

Ciao Giuseppe,
sono riuscito a realizzare ciò, aggiungendo quanto già chiesto nei test.Ti allego il VI (Spero possa essere utile per gli altri dato che utilizzo a volte questo forum per qualche idea).Adesso, vorrei però fare ciò, utilizzare il framework .Net con la libreria Labview .Se hai qualche consiglio, fammi sapere.
A presto!!!!!!!!!!!!!! 
Attachments:
Scheduler_evo.vi ‏34 KB

Similar Messages

  • File in design CC non si apre perchè dice che è stato creato con una versione di adobe in design CC 2014. com'è possibile?

    mi dareste una mano?
    perchè non sò veramente come aprire il file.
    grazie
    ciao

    It looks like you are already a Creative Cloud subscriber, so if your OS will support the 2014 version all you need to do is download and install it through the CC Desktop Application.

  • CAn I make a push button LED blink

    Take the"modern" pushbutton control.
    The LED on the control is on when the control is pressed (true) and off then false.
    Can I make the LED blink when false and be on solid like normal when true?
    I tried the property node "blink" but that kakes the whole control blink (and looks stupid)

    Hi RTSLVU,
    Here is another example of how you can cheat to get it done. It combines a custom Boolean LED and a regular Boolean Push Button. If you don't want to mess with custom controls, you can overlay a regular Round LED Boolean (stretching it out a bit makes it fit better) over the existing LED on the Push Button, it'll just look a little different.
    Thank you for choosing National Instruments.
    Aaron Pena
    National Instruments
    Applications Engineer
    http://www.ni.com/support
    Attachments:
    Another Blinking LED in Pushbutton.vi ‏8 KB
    testcontrol.ctl ‏4 KB

  • Why do boolean indicator outputs toggle when true is written repeatedly?

    Hi,
    I'm using an LED boolean indicator in a sub vi connected to an output terminal.
    If TRUE is repeatedly written to it then it toggles between ON and OFF as though it were a push button switch and each TRUE received was someone pushing the switch.
    If I disconnect it from the output terminal then it behaves as expected, staying ON if TRUE is repeatedly received.
    Why does it do this, how can I fix it?
    Also, how can I turn all breakpoints off collectively without removing them?
    Thanks,
    Dave G
    (LabView V7.0)

    Hi Dave,
    go to File>>VI Porperties>>Execution and check if "Clear indiators if called" is checked.
    If this is checked it clears the indicator when the VI is called. If you set the value to TRUE this value will be given back to the calling VI.
    This behaviour was introduced to allow simpler programming. Think of a programm with various cases. There is only one case where you want to set the indicator to TRUE. If you haven't the above flag you need to set it to FALSE in all other cases. This forces to move the terminal outside of the case and to wire a lot of FALSE constants to the tunnel (nowadays we have the "use default if unwired" mechanism which makes the flag unnesseccary).
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How to invisible LED in cluster from front windows

    Hi guys,
    I have cluster inside array1*8 it has three LEDs, sometimes i need one or two LEDs, so how to invisible extra LED from cluster.
    I knew how invisible some buttons or string...etc. But my question how to invisible inside cluster that is inside array
    Thanks and best regards.

    OK Array of clusters containing "Invisible" controls-
    Since all elements in an array must share all properties except value we need a solution where the value property controls visibility as far as users are concerned.  LEDs (Booleans) are out-
    BUT, if you used Color boxes instead of booleans you can set the value to "LED Off" "LED On" or "Transparent"
    Jeff
    Attachments:
    Control 2.ctl ‏7 KB

  • Ho comprato il 20 dicembre l'iPhone 5 in offerta dalla TIM. Da allora sono alle prese con il continuo passaggio dal 3G ad Edge. Fatto ripristino e reset di rete più volte, ma né la TIM né Apple riconoscono il problema, ma si rimpallano la responsabilità.

    Ho comprato il 20 dicembre l'iPhone 5 in offerta dalla TIM. Da allora sono alle prese con il continuo passaggio dal 3G ad Edge. Per ritornare al 3G devo attivare e disattivare l'opzione "aereo" o "3G". Ho fatto il ripristino dell'iphone e il reset di rete della nano sim più volte senza concludere nulla, ma né la TIM né Apple riconoscono il problema, anzi si rimpallano la responsabilità. Che fare?

    Facendo varie prove (come l'inserimento della nano sim in un cellulare Nokia) e confrontando il comportamento dell'iPhone 5 con un altro iPhone 5  - sempre con nano sim TIM - in zone diverse della città in cui abito (Palermo), sono pervenuto alla seguente conclusione: c'è un problema del dispositivo, ma c'è anche un problema di regolazione del segnale dal parte del gestore TIM.
    Non sono un tecnico e non so spiegare perchè ciò avvenga, anzi mi piacerebbe saperlo sia dalla Apple che da TIM, ma dubito che dichiarino apertamente il problema. Se non si capisce perchè ciò avvenga, è inutile sostituire telefono e nano sim.
    Io ho cambiato nano sim e il problema è rimasto. Ho avviato on line con un operatore Apple la pratica di sotituzione dell'iPhone: mi mandano un corriere a ritirarlo e me lo riportano in una settimana. Ma qui mi sono fermato e non ho proceduto ancora alla sostituzione, perchè mi è stato detto che mi sarebbe stato sostituito con un "rigenerato".
    Come nuovo non è la stessa cosa di nuovo e in rete leggo di clienti che dopo la sostituzione continuano ad avere lo stesso problema.
    Chiediamo a Apple di dirci con chiarezza se c'è una partita di iPhone 5 con qualche elemento difettoso o non adatto al mercato italiano o se è un problema di software (e in quel caso aspetteremo pazientemente un aggiornamento) e a TIM chiediamo di non blindare il 119. Infatti da alcuni giorni è impossibile contattare un operatore. Come mai? Subissata dalle lamentele dei clienti?
    Ho molta voglia di rescindere il contratto di trenta mesi...

  • How to create and illuminate a multi-indi​cator?

    Hello all!!
    I'm a complete noob with LV and first post to the forum.
    I'm hoping I can get some help in form of suggestions or links to examples, tutorials or somewhere to just research info on my problem.
    ON the front panel, I'm needing to put some indicators, each of  which look like the LED indicator...but have the capability to have 3 or more different states....rather than just the two offered by the boolean LED object.
    A simple example of something like I'm trying to do, would be a single indicator for a stop light...having different colors and captions/lables  for different states in my code:
    RED-Stop
    YELLOW-Caution
    GREEN-Go
    I'd looked under the graphs->controls palette..and seen a 2d picture control and when rt clicking on that in the block diagram area, I saw the option for Picture Palette Functions, and in there saw options for draw round....etc.  But I'm not sure what to connect this to, or how to control it associated with the 2D picture object.
    Is that the way I'd have to do this? If so...any suggestions where I could look for an example ?
    If not this..what would be the best way I should try to look into doing this?
    Thank you in advance,
    cayenne
    PS. I have Labview 2011

    later versions have a round color box But, as shown below there are a few issues
    First it lacks the shading. second it does not size the same as an LED boolean.
    Well we can fix one of those the shading is easy enough to duplicate.  Just copy the LED color area to clipboard and import it to the color control color area at same size.  A little futzing with sizes and viola'.
    The attached example uses a shading I prefer but serves to illustrate
    Jeff
    Attachments:
    Shaded Sliver Color box.ctl ‏4 KB

  • Error executing a Oracle query when connection is fetched from Datasource

    Hi Folks,
    I am struggling with a rather wierd issue. The DBA of my application has exposed some function based view(not exactly sure what that means) which returns results like any query over a table. I am having a tough time consuming it in my java application. The name of the view is - `networknode_api.get_ftapp_networknode_hrchy` The SQL for it is(syntax might be a bit strange as there is actual word `table` in the query)
    view plaincopy to clipboardprint?
    Note: Text content in the code blocks is automatically word-wrapped
    01.SELECT * FROM table (networknode_api.get_ftapp_networknode_hrchy('19-Feb-2013'));
    SELECT * FROM table (networknode_api.get_ftapp_networknode_hrchy('19-Feb-2013'));
    The query returns a hierarchical result data, provided below is a sample output (ignore the ouput if the formatting is too werid)
    Parent_NODE | Child_NODE | NODE_DISPLAY_NAME | BEGIN_DATE | END_COB_DATE | LVL
    null | CCN | Connent Node | 01/20/2013 | 10/19/2013 | 1
    CCN | AVT | Avg Vol Turn | 01/20/2013 | 10/19/2013 | 2
    AVT | L:2 | L:2 | 01/20/2013 | 10/19/2013 | 3
    AVT | L:6 | L:6 | 01/20/2013 | 10/19/2013 | 3
    CCN | NUT | Nap Up Turn | 01/20/2013 | 10/19/2013 | 2
    I have the following method in my DAO -
    public List<NetworkNodeGroupDTO> fetchNetworkNodeHierarchy(Date cobDate) {
    try {
    InitialContext ic = new InitialContext();
    //DataSource ds1 = (DataSource) ic.lookup("jndiDsFlex");
    //Connection conn = ds1.getConnection();
    /* Using the RmiDataSource class for performance optimizations */
    weblogic.jdbc.common.internal.RmiDataSource ds = (weblogic.jdbc.common.internal.RmiDataSource) ic.lookup("jndiDsNex");
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    boolean hasRows = stmt.execute("SELECT * FROM table (networknode_api.get_ftapp_networknode_hrchy('19-Feb-2013'))");
    rs = stmt.getResultSet();
    while(rs.next()) {
    System.out.println(rs.getString("parent_node"));
    System.out.println(rs.getString("child_node"));
    System.out.println(rs.getString("node_display_name"));
    stmt.close(); stmt = null;
    conn.close(); conn = null;
    } catch(Exception ex) {
    ex.printStackTrace();
    return null; // please ignore the return type for now
    Exception is thrown at line - stmt.execute(....)
    java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier
    I debugged through the code and noted the driver and connection details that the connection object has embedded. Using that I wrote a sample java jdbc code-
    public static void main(String[] args) throws Exception {
    try {
    //Class.forName("oracle.jdbc.driver.OracleDriver");
    //Class.forName("weblogic.jdbc.rmi.Driver");
    Driver myDriver = (Driver) Class.forName("weblogic.jdbc.jts.Driver").newInstance();
    } catch (ClassNotFoundException e) {
    System.out.println("Where is your Oracle JDBC Driver?");
    e.printStackTrace();
    return;
    Connection connection = null;
    try {
    connection = DriverManager.getConnection(
    "jdbc:oracle:thin:@//ssn20331020-rt.eu.prog.net:1522/NEXSERV",
    "sample",
    "sample1234");
    } catch (SQLException e) {
    System.out.println("Connection Failed! Check output console");
    e.printStackTrace();
    return;
    Statement stmt = connection.createStatement();
    stmt.execute("SELECT * FROM table (flex_compnode_api.get_ftapp_compnode_hrchy('19-Feb-2013'))");
    ResultSet rs = stmt.getResultSet();
    int i = 0;
    while(rs.next()) {
    String pNode = rs.getString("parent_node");
    String cNode = rs.getString("child_node");
    String dName = rs.getString("node_display_name");
    System.out.println("Hello: "+i++);
    The above code works perfectly fine. Also tried the above code using normal Oracle JDBC driver and too works fine. I am baffled; what goes wrong when using the connection from a DataSource object. Does the driver treat SQL statements differently based on how the connection object is obtained? Appreciate your inputs/comments for same.
    The oracle db version is - Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    Application Server - Weblogic 10.3

    Below is the stacktrace and the driver details which are same for both the standalone basic Jdbc program and one where connection is fetched through datasource.
    Driver name: Oracle JDBC driver
    Driver version : 11.2.0.2.0
    Driver major ver: 11
    Driver minor ver: 2
    java.sql.SQLSyntaxErrorException: ORA-00904: : invalid identifier
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
    at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
    at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:445)
    at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191)
    at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523)
    at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:193)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:852)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275)
    at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1890)
    at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1855)
    at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:304)
    at weblogic.jdbc.wrapper.Statement.execute(Statement.java:458)
    at com.rfs.gs.ggl.nex.persistence.jpa.FlagDao.fetchCompositeNodeHierarchy(FlagDao.java:258)
    at com.rfs.gs.ggl.nex.service.mars.GSServiceBean.searchCompositeNode(GSServiceBean.java:192)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.jee.intercept.JeeInterceptorInterceptor.invoke(JeeInterceptorInterceptor.java:69)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
    at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
    at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at $Proxy119.searchCompositeNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
    at $Proxy92.searchCompositeNode(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:101)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:83)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:152)
    at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:264)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at weblogic.wsee.jaxws.tubeline.FlowControlTube$FlowControlAwareTube.processRequest(FlowControlTube.java:148)
    at weblogic.wsee.jaxws.tubeline.FlowControlTube.processRequest(FlowControlTube.java:99)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:604)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:563)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:548)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:445)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:275)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:250)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:140)
    at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:319)
    at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:232)
    at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:310)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3594)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    <Timestamp Fri Feb 22 11:41:19 EST 2013 (1361551279781)>

  • Calling a method from another servlet? very beginner

    I am going to try to explain what I want to do so just be patient please.
    I want to call a method in a seperate servlet to connect and release my connection pool - How do I do this?
    This is what I have been trying... help
    dbPOOL.class
    package DATABASE;
    import javax.naming.*;
    import javax.sql.*;
    import java.sql.*;
    import java.util.*;
    public class dbPOOL {
      Connection con;
      private boolean conFree = true;
      private String dbName = "java:comp/env/jdbc/connectDB";
      public dbPOOL() throws Exception {
           try  {              
                    InitialContext ic = new InitialContext();
                    DataSource ds = (DataSource) ic.lookup(dbName);
                    con =  ds.getConnection();    
         } catch (Exception ex) { throw new Exception("Couldn't open connection to database: " + ex.getMessage());
      public void remove () {
             try {
                 con.close();
            } catch (SQLException ex) { System.out.println(ex.getMessage());}
      protected synchronized Connection getConnection() {
             while (conFree == false) {
                     try {
                             wait();
                     } catch (InterruptedException e) {
                  conFree = false;
                  notify();
                  return con;
        protected synchronized void releaseConnection() {
            while (conFree == true) {
                     try {
                        wait();
                     } catch (InterruptedException e) {
                  conFree = true;
                  notify();
    }and my worker servlet connTest
    package DATABASE;
    import javax.naming.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class connTest extends HttpServlet {  
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, SQLException, IOException {
             try {
                    String selectStatement = "select * " + "from mt.Evendale_Web_Groups";
                    getConnection();
                    PreparedStatement prepStmt = con.prepareStatement(selectStatement);
                    ResultSet rs = prepStmt.executeQuery();
                    while (rs.next()) {
                       groupList gl = new groupList(rs.getString(1), rs.getString(2), rs.getString(3));
                    prepStmt.close();
            } catch (SQLException ex) { throw Exception(ex.getMessage());}
                releaseConnection();
    }When I try to compile the connTest servlet - I keep getting cannot find symbols errors on the methods. How do I fix this?

    Which errors exactly?
    Try something like this:
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    dbPOOL db = null;     
    try {               
    String selectStatement = "select * " + "from mt.Evendale_Web_Groups";
    db = new dbPOOL();        
    Connection con = db.getConnection();               
    PreparedStatement prepStmt = con.prepareStatement(selectStatement);               
    ResultSet rs = prepStmt.executeQuery();               
    while (rs.next()) {                                    
       // process your rs                      
    prepStmt.close();           
    } catch (Exception ex) {
    } finally {
        if (db != null)
             db.releaseConnection();             
    }Simply change the package name to something else. But don't forget to import your dbPOOL class since it is now located in a diff package. Also be aware of coding standards when naming your classes and packages.

  • Update problems, no space left on device (ZTE Open)

    I just received a ZTE Open device in the mail today, and after playing around with it a bit, I noticed that every time I tried to check for system updates, it would show me one 13.xx MB update, which I downloaded, apparently applied, and the phone seemed to restart itself, but then I would be shown the same (??) update available. The phone is without a SIM card, just playing with it connected via Wifi, with the 4GB microSD card installed. Then, this evening, I got an error message, which apparently was recorded on the SD card, a file called recovery.log (contents follow):
    <pre><nowiki>Starting recovery on Fri Aug 23 07:29:21 2013
    framebuffer: fd 4 (320 x 480)
    recovery filesystem table
    =========================
    0 /tmp ramdisk (null) (null) 0
    1 /boot mtd boot (null) 0
    2 /amss mtd amss (null) 0
    3 /appsbl mtd appsbl (null) 0
    4 /mibib mtd mibib (null) 0
    5 /qcsbl mtd qcsbl (null) 0
    6 /oemsbl1 mtd oemsbl1 (null) 0
    7 /oemsbl2 mtd oemsbl2 (null) 0
    8 /splash mtd splash (null) 0
    9 /cache yaffs2 cache (null) 0
    10 /data yaffs2 userdata (null) 0
    11 /misc mtd misc (null) 0
    12 /recovery mtd recovery (null) 0
    13 /sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 0
    14 /system yaffs2 system (null) 0
    I:Got arguments from /cache/recovery/command
    mtd: successfully wrote block at 0
    I:Set boot command "boot-recovery"
    Command: "/sbin/recovery"
    ro.secure=1
    ro.allow.mock.location=0
    ro.debuggable=0
    ro.build.id=IMM76D
    ro.build.display.id=OPEN_US_DEV_FFOS_V1.0.0B01
    ro.build.version.incremental=eng..20130724.030603
    ro.build.version.sdk=15
    ro.build.version.codename=REL
    ro.build.version.release=4.0.4
    ro.build.sw_internal_version=US_DEV_FFOS_V1.0.0B01
    ro.build.baseband_version=P752D04B02
    ro.build.firmware_revision=V1.01.00.01.019.144
    ro.build.date=2013年 07月 24日 星期三 03:06:47 CST
    ro.build.date.utc=1374606407
    ro.build.type=user
    ro.build.user=
    ro.build.host=ThinkCentre2-XXXX
    ro.build.tags=test-keys
    ro.product.model=roamer2
    ro.product.external_model=ZTE OPEN
    ro.product.brand=ZTE
    ro.product.name=roamer2
    ro.product.device=roamer2
    ro.product.board=roamer2
    ro.product.cpu.abi=armeabi-v7a
    ro.product.cpu.abi2=armeabi
    ro.product.manufacturer=ZTE
    ro.product.locale.language=en
    ro.product.locale.region=US
    ro.wifi.channels=
    ro.board.platform=msm7627a
    ro.build.product=roamer2
    ro.build.description=roamer2-user 4.0.4 IMM76D eng..20130724.030603 test-keys
    ro.build.fingerprint=ZTE/roamer2/roamer2:4.0.4/IMM76D/eng..20130724.030603:user/test-keys
    ro.build.characteristics=default
    rild.libpath=/system/lib/libril-qc-1.so
    rild.libargs=-d /dev/smd0
    persist.rild.nitz_plmn=
    persist.rild.nitz_long_ons_0=
    persist.rild.nitz_long_ons_1=
    persist.rild.nitz_long_ons_2=
    persist.rild.nitz_long_ons_3=
    persist.rild.nitz_short_ons_0=
    persist.rild.nitz_short_ons_1=
    persist.rild.nitz_short_ons_2=
    persist.rild.nitz_short_ons_3=
    ril.subscription.types=NV,RUIM
    DEVICE_PROVISIONED=1
    debug.sf.hw=1
    debug.composition.7x27A.type=mdp
    debug.composition.7x25A.type=mdp
    dalvik.vm.heapsize=128m
    persist.cne.UseCne=none
    persist.cne.bat.range.low.med=30
    persist.cne.bat.range.med.high=60
    persist.cne.loc.policy.op=/system/etc/OperatorPolicy.xml
    persist.cne.loc.policy.user=/system/etc/UserPolicy.xml
    persist.cne.bwbased.rat.sel=false
    persist.cne.snsr.based.rat.mgt=false
    persist.cne.bat.based.rat.mgt=false
    persist.cne.rat.acq.time.out=30000
    persist.cne.rat.acq.retry.tout=0
    persist.cne.fmc.mode=false
    persist.cne.fmc.init.time.out=30
    persist.cne.fmc.comm.time.out=130
    persist.cne.fmc.retry=false
    media.stagefright.enable-player=true
    media.stagefright.enable-meta=false
    media.stagefright.enable-scan=true
    media.stagefright.enable-http=true
    media.stagefright.enable-fma2dp=true
    media.stagefright.enable-aac=true
    media.stagefright.enable-qcp=true
    ro.opengles.version=131072
    ro.use_data_netmgrd=true
    persist.data.ds_fmc_app.mode=0
    persist.ims.regmanager.mode=0
    ro.bluetooth.request.master=true
    ro.qualcomm.bluetooth.sap=false
    ro.bluetooth.remote.autoconnect=true
    persist.sys.strictmode.visual=false
    persist.omh.enabled=1
    ro.config.ehrpd=true
    ro.qualcomm.cabl=1
    ro.fm.analogpath.supported=true
    ro.fm.transmitter=false
    ro.fm.mulinst.recording.support=false
    ro.hw_plat=7x27a
    ro.emmc.sdcard.partition=18
    ro.screen.layout=normal
    debug.enabletr=false
    debug.camcorder.disablemeta=0
    persist.fuse_sdcard=false
    debug.camera.landscape=true
    ro.max.fling_velocity=4000
    hwui.render_dirty_regions=false
    httplive.enable.discontinuity=true
    power.webview.DM=false
    dalvik.vm.heapstartsize=5m
    dalvik.vm.heapgrowthlimit=36m
    org.bluez.device.conn.type=boolean
    keyguard.no_require_sim=true
    ro.com.android.dataroaming=false
    ro.com.android.dateformat=MM-dd-yyyy
    ro.config.ringtone=Ring_Synth_04.ogg
    ro.config.notification_sound=pixiedust.ogg
    ro.config.alarm_alert=Alarm_Classic.ogg
    ro.vendor.extension_library=/system/lib/libqc-opt.so
    ro.display.colorfill=1
    ro.moz.ril.emergency_by_default=true
    ro.moz.omx.hw.max_width=640
    ro.moz.omx.hw.max_height=480
    ro.moz.cam.0.sensor_offset=270
    ro.moz.ril.simstate_extra_field=true
    persist.sys.ztelog.enable=1
    persist.radio.add_power_save=1
    ro.sensor.arch.type=new
    net.bt.name=Android
    net.change=net.bt.name
    dalvik.vm.stack-trace-file=/data/anr/traces.txt
    ro.factorytest=0
    ro.serialno=ROAMER2
    ro.bootmode=unknown
    ro.baseband=msm
    ro.carrier=unknown
    ro.bootloader=unknown
    ro.hardware=roamer2
    ro.revision=0
    ro.emmc=0
    init.svc.recovery=running
    E:Error in /cache/recovery/log
    (No space left on device)
    E:Error in /cache/recovery/last_log
    (No space left on device)
    mtd: successfully wrote block at 0
    I:Set boot command ""
    E:Error in /cache/recovery/log
    (No space left on device)
    E:Error in /cache/recovery/last_log
    (No space left on device)</nowiki></pre>
    The SD card also contains a zip file in updates/fota/update.zip, which in turn contains patch/system/P752D04_DEV_US_20130726.zip, which contains: amss.mbn (about 20 meg) and boot.img (about 4 meg).

    Just jumping in here, I received mine on the 23rd and I am also seeing the same problem, but the logs are a bit different. Although, I am running OPEN_US_DEV_FFOS_V1.0.0'''B02'''. While the recovery log states B01.
    I'll toss my log up as well so trends can be examined.
    Starting recovery on Sun Aug 25 07:04:10 2013
    framebuffer: fd 4 (320 x 480)
    recovery filesystem table
    =========================
    0 /tmp ramdisk (null) (null) 0
    1 /boot mtd boot (null) 0
    2 /amss mtd amss (null) 0
    3 /appsbl mtd appsbl (null) 0
    4 /mibib mtd mibib (null) 0
    5 /qcsbl mtd qcsbl (null) 0
    6 /oemsbl1 mtd oemsbl1 (null) 0
    7 /oemsbl2 mtd oemsbl2 (null) 0
    8 /splash mtd splash (null) 0
    9 /cache yaffs2 cache (null) 0
    10 /data yaffs2 userdata (null) 0
    11 /misc mtd misc (null) 0
    12 /recovery mtd recovery (null) 0
    13 /sdcard vfat /dev/block/mmcblk0p1 /dev/block/mmcblk0 0
    14 /system yaffs2 system (null) 0
    I:Got arguments from /cache/recovery/command
    mtd: successfully wrote block at 0
    I:Set boot command "boot-recovery"
    Command: "/sbin/recovery" "--update_package=/sdcard/updates/fota/update.zip"
    ro.secure=1
    ro.allow.mock.location=0
    ro.debuggable=0
    ro.build.id=IMM76D
    ro.build.display.id=OPEN_US_DEV_FFOS_V1.0.0B01
    ro.build.version.incremental=eng..20130724.030603
    ro.build.version.sdk=15
    ro.build.version.codename=REL
    ro.build.version.release=4.0.4
    ro.build.sw_internal_version=US_DEV_FFOS_V1.0.0B01
    ro.build.baseband_version=P752D04B02
    ro.build.firmware_revision=V1.01.00.01.019.144
    ro.build.date=2013年 07月 24日 星期三 03:06:47 CST
    ro.build.date.utc=1374606407
    ro.build.type=user
    ro.build.user=
    ro.build.host=ThinkCentre2-XXXX
    ro.build.tags=test-keys
    ro.product.model=roamer2
    ro.product.external_model=ZTE OPEN
    ro.product.brand=ZTE
    ro.product.name=roamer2
    ro.product.device=roamer2
    ro.product.board=roamer2
    ro.product.cpu.abi=armeabi-v7a
    ro.product.cpu.abi2=armeabi
    ro.product.manufacturer=ZTE
    ro.product.locale.language=en
    ro.product.locale.region=US
    ro.wifi.channels=
    ro.board.platform=msm7627a
    ro.build.product=roamer2
    ro.build.description=roamer2-user 4.0.4 IMM76D eng..20130724.030603 test-keys
    ro.build.fingerprint=ZTE/roamer2/roamer2:4.0.4/IMM76D/eng..20130724.030603:user/test-keys
    ro.build.characteristics=default
    rild.libpath=/system/lib/libril-qc-1.so
    rild.libargs=-d /dev/smd0
    persist.rild.nitz_plmn=
    persist.rild.nitz_long_ons_0=
    persist.rild.nitz_long_ons_1=
    persist.rild.nitz_long_ons_2=
    persist.rild.nitz_long_ons_3=
    persist.rild.nitz_short_ons_0=
    persist.rild.nitz_short_ons_1=
    persist.rild.nitz_short_ons_2=
    persist.rild.nitz_short_ons_3=
    ril.subscription.types=NV,RUIM
    DEVICE_PROVISIONED=1
    debug.sf.hw=1
    debug.composition.7x27A.type=mdp
    debug.composition.7x25A.type=mdp
    dalvik.vm.heapsize=128m
    persist.cne.UseCne=none
    persist.cne.bat.range.low.med=30
    persist.cne.bat.range.med.high=60
    persist.cne.loc.policy.op=/system/etc/OperatorPolicy.xml
    persist.cne.loc.policy.user=/system/etc/UserPolicy.xml
    persist.cne.bwbased.rat.sel=false
    persist.cne.snsr.based.rat.mgt=false
    persist.cne.bat.based.rat.mgt=false
    persist.cne.rat.acq.time.out=30000
    persist.cne.rat.acq.retry.tout=0
    persist.cne.fmc.mode=false
    persist.cne.fmc.init.time.out=30
    persist.cne.fmc.comm.time.out=130
    persist.cne.fmc.retry=false
    media.stagefright.enable-player=true
    media.stagefright.enable-meta=false
    media.stagefright.enable-scan=true
    media.stagefright.enable-http=true
    media.stagefright.enable-fma2dp=true
    media.stagefright.enable-aac=true
    media.stagefright.enable-qcp=true
    ro.opengles.version=131072
    ro.use_data_netmgrd=true
    persist.data.ds_fmc_app.mode=0
    persist.ims.regmanager.mode=0
    ro.bluetooth.request.master=true
    ro.qualcomm.bluetooth.sap=false
    ro.bluetooth.remote.autoconnect=true
    persist.sys.strictmode.visual=false
    persist.omh.enabled=1
    ro.config.ehrpd=true
    ro.qualcomm.cabl=1
    ro.fm.analogpath.supported=true
    ro.fm.transmitter=false
    ro.fm.mulinst.recording.support=false
    ro.hw_plat=7x27a
    ro.emmc.sdcard.partition=18
    ro.screen.layout=normal
    debug.enabletr=false
    debug.camcorder.disablemeta=0
    persist.fuse_sdcard=false
    debug.camera.landscape=true
    ro.max.fling_velocity=4000
    hwui.render_dirty_regions=false
    httplive.enable.discontinuity=true
    power.webview.DM=false
    dalvik.vm.heapstartsize=5m
    dalvik.vm.heapgrowthlimit=36m
    org.bluez.device.conn.type=boolean
    keyguard.no_require_sim=true
    ro.com.android.dataroaming=false
    ro.com.android.dateformat=MM-dd-yyyy
    ro.config.ringtone=Ring_Synth_04.ogg
    ro.config.notification_sound=pixiedust.ogg
    ro.config.alarm_alert=Alarm_Classic.ogg
    ro.vendor.extension_library=/system/lib/libqc-opt.so
    ro.display.colorfill=1
    ro.moz.ril.emergency_by_default=true
    ro.moz.omx.hw.max_width=640
    ro.moz.omx.hw.max_height=480
    ro.moz.cam.0.sensor_offset=270
    ro.moz.ril.simstate_extra_field=true
    persist.sys.ztelog.enable=1
    persist.radio.add_power_save=1
    ro.sensor.arch.type=new
    net.bt.name=Android
    net.change=net.bt.name
    dalvik.vm.stack-trace-file=/data/anr/traces.txt
    ro.factorytest=0
    ro.serialno=ROAMER2
    ro.bootmode=unknown
    ro.baseband=msm
    ro.carrier=unknown
    ro.bootloader=unknown
    ro.hardware=roamer2
    ro.revision=0
    ro.emmc=0
    init.svc.recovery=running
    Finding update package...
    I:Update location: /sdcard/updates/fota/update.zip
    Opening update package...
    I:1 key(s) loaded from /res/keys
    Verifying update package...
    I:comment is 1746 bytes; signature 1728 bytes from end
    I:whole-file signature verified against key 0
    I:verify_file returned 0
    Installing update...
    try_update_binary(path(/sdcard/updates/fota/update.zip))
    radio.diff not found
    Verifying current system...Failed to mount /dev/block/mtdblock4 on /cache: Device or resource busy
    mtd mount of cache failed: Device or resource busy
    51191808 bytes free on /cache (5714 needed)
    applying patch to /system/build.prop
    "/system/build.prop" is already target; no patch needed
    Removing unneeded files...
    Patching system files...
    Symlinks and permissions...
    script result was [/system]

  • Digital Output With Timer (Simulation)

    Hello everyone, I just learned how to make LabVIEW program a week ago. I try to make a simulation of Digital Output by LabVIEW (my attachment). In this simulation I have a slider as an input (0-10 V), two numeric control (upper limit and bottom limit), a waveform chart that plot those 3 value, and two boolean LED (P0.0 and P0.1) as an indicator. In this simulation you can fill any number (between 0-10) in the numeric control as a limit for your slider input. If the input from a slider exceed those upper and bottom limit then the boolean LED will turn on, P0.0 if exceed upper limit and P0.1 if exceed bottom limit. The problem is I don't know how to make timer for those boolean LED. As example:
    1) Make an input from slider,
    2) If input (1) exceed the upper limit,P0.0 will turn on for 5 second,then turn of for 10 second,
    3) If in that 10 second you change the input back to normal (between upper and bottom limit) then P0.0 will stay turn of until the input from slider exceed the upper limit again,
    4)If in that 10 second you didn't change the input (stay exceed the upper limit) then P0.0 will repeat the process (2) until you the input from slider back to normal.
    (Same process for input that exceed the bottom limit).
    Can you help me to make this timer? Thank You (I'm sorry I made a double post):newbie
    Regards
    Juventom
    Attachments:
    Digital Output With Timer.vi ‏16 KB

    Hello Juventom,
    As I understand it you want to be continuously checking the value of the sliding bar and comparing that to the upper and lower limit controls whilest also chaning the LED booleans to true for 5 seconds then false for 10 seconds if the sliding bar value is outside of the limits.
    To do this you would probably be best using a parallel loop design, where you have 3 while loops in place of the one you have currently. Each one of these while loops would be responsible for a part of your program (e.g. the top one would display your values on the graph and the second one who check the sliding bar value against the upper limit and then turn on the LED, etc)
    I've found this tutorial about multiple loop programs and I think you should look at the section entitled "Parallel Execution"
    http://zone.ni.com/devzone/cda/tut/p/id/3749
    This way you can use normal delay VIs but when they run they only pause that loop rather than the whole program.
    Please let me know how you get on with this, and ask me if you need further help.
    James W
    Controls Systems Engineer
    STFC

  • How to add an image file to Oracle db?

    Need help urgently....Anybody knows how to add an image file (example: jpg)into one of the fields in Oracle database??

    This will do the job..
    package forum;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    //import oracle.sql.*;
    Wanneer een request.getInputStream wordt geconferteerd naar een "String" (zie later) dan ziet de output in tekstformaat er als volgt uit:
    -----------------------------7d280152604f4 Content-Disposition: form-data; name="oploadfile"; filename="C:\WINNT\Profiles\mvo\Desktop\boodschap.txt" Content-Type: text/plain Deze boodschap dient te worden ge-insert in de database. -----------------------------7d280152604f4 Content-Disposition: form-data; name="StadID" 1234 -----------------------------7d280152604f4 Content-Disposition: form-data; name="SuccessPage" /forum/error.jsp -----------------------------7d280152604f4--
    of opgesplitst
    contentType........... multipart/form-data; boundary=---------------------------7d235ade00f0
    filename.............. "C:\Documents and Settings\Administrator\Desktop\boodschap.txt"
    MIME type............. text/plain
    Wat in database moet.. Dit is de eigenlijke boodschap die moet worden ge-insert in de database.
    Eind boundary......... -----------------------------7d235ade00f0 Content-Disposition: form-data; name="file1"; filename="" Content-Type: application/octet-stream -----------------------------7d235ade00f0--
    We gaan achtereenvolgens:
    1. Kijken of het van het "multipart/form-data" type is (uploaden) en strippen van eerste boundery.
    1.a Geen "multipart/form-data" ? dan... error message
    1.b Groter dan MAX_SIZE ?..dan .. error message
    2. Filenaam van de te uploaden file uitlezen
    3. Mimetype bepalen en bepalen in welke positie van de string het Mimetype ophoudt, cq waar te uploaden file begint
    4. Bepalen waar eind boundery begint
    5. De eigenlijke file uitlezen
    6. Terug converteren naar bytes
    public class WriteBlob extends HttpServlet {
    public static final int MAX_SIZE = ParameterSettings.imageUpload;
    String successMessage = "";
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    * Process the HTTP Get request
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    DataInputStream in = null;
    FileOutputStream fileOut= null;
    PrintWriter out = response.getWriter();
    int kb_size = 0;
    boolean pass2 = true;
    String message = "";
    String responseRedirect = "/forum/uploaden.jsp?message="+" Uploaden geslaagd";
    try
    //get content type of client request
    String contentType = request.getContentType();
    // Start stap 1...content type is multipart/form-data
    if(contentType != null && contentType.indexOf("multipart/form-data") != -1)
    //open input stream
    in = new DataInputStream(request.getInputStream());
    //get length of content data
    int formDataLength = request.getContentLength(); // totale lengte van de inputstream
    //initieer een byte array om content data op te slaan
    byte dataBytes[] = new byte[formDataLength];
    //read file into byte array
    int bytesRead = 0;
    int totalBytesRead = 0;
    int sizeCheck = 0;
    while (totalBytesRead < formDataLength)
    //kijken of de file niet te groot is
    sizeCheck = totalBytesRead + in.available();
    if (sizeCheck > MAX_SIZE)
    pass2 = false;
    message = "Sorry. U kunt slechts bestanden uploaden tot een grootte van 500KB";
    responseRedirect = "/forum/uploaden.jsp?message="+message;
    bytesRead = in.read(dataBytes, totalBytesRead,formDataLength);
    totalBytesRead += bytesRead;
    if (pass2==true)
    kb_size = (int)(formDataLength/1024);
    //create string from byte array for easy manipulation
    String file = new String(dataBytes);
    /*get boundary value (boundary is a unique string that separates content data)
    contentType........... multipart/form-data; boundary=---------------------------7d235ade00f0
    int lastIndex = contentType.lastIndexOf("=");
    String boundary = contentType.substring(lastIndex+1, contentType.length());
    // Stap 2.....bepaal de naam van de upload file
    // filename.............. "C:\Documents and Settings\Administrator\Desktop\boodschap.txt"
    String saveFile = file.substring(file.indexOf("filename=\"")+10);
    saveFile = saveFile.substring(0,saveFile.indexOf("\n"));
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\")+1,saveFile.indexOf("\"")); //naam van de file...boodschap.txt
    String saveFileName = saveFile;
    // Stap 3..Bepaal MIME Type en de positie van eind mime type in string
    voorbeeld: -----------------------------7d23d21220524 Content-Disposition: form-data; name="file0"; filename="C:\WINNT\Profiles\mvo\Desktop\z clob.txt" Content-Type: text/plain
    String restant = "";
    int pos; //position in upload file
    // bijv .. filename="C:\Documents and Settings\Administrator\Desktop\boodschap.txt"
    pos = file.indexOf("filename=\"");
    //find position of content-disposition line
    pos = file.indexOf("\n",pos)+1; // eing file naam + spatie
    // onderstaand geeft bijv Content-Type: text/plain
    restant = file.substring(pos,file.indexOf("\n",pos)-1);
    restant = restant.substring(restant.indexOf(":")+2,restant.length()); // MIME type
    String mimeType = restant;
    //find position of eind content-type line
    pos = file.indexOf("\n",pos)+1;
    //find position of blank line
    pos = file.indexOf("\n",pos)+1;
    int start = pos;
    // Stap 4 eind boundary
    /*find the location of the next boundary marker (marking the end of the upload file data)*/
    int boundaryLocation = file.indexOf(boundary,pos)-4; //waarom -4 ..? ziet er uit als linebreak spatie--boundary=-----------------------------7d21c9ae00f0
    // Stap 5 en 6..de eigelijke te uploaden file in nieuwe byte file inserten
    byte dataBytes2[] = new byte[boundaryLocation-start]; //declareren
    for (int i=0;i<(boundaryLocation-start);i++) // inserten BELANGRIJK !!
    dataBytes2=dataBytes[start+i];
    String next_id = "0";
    Statement statement = null;
    Connection conn = null;
    boolean pass = true;
    ResultSet rs = null;
    Statement stmt_empty = null;
    oracle.sql.BLOB blb = null;
    try
    int vendor = DriverUtilities.ORACLE;
    String username = ConnectionParams.userName;
    String password = ConnectionParams.passWord;
    String connStr = DriverUtilities.makeURL(vendor);
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection(connStr,username, password);
    if (conn==null){pass=false;}
    } catch (Exception e){out.println("<P>" + "There was an error establishing a connection:");}
    if (pass==true)
    try
    String seq_nextval ="select forum_blob_seq.nextval from dual";
    statement = conn.createStatement();
    ResultSet rset = statement.executeQuery(seq_nextval);
    while (rset.next())
    next_id = rset.getString(1);
    if (next_id.equals("0"))
    message = "Uploaden mislukt !...Er ging wat fout tijdens de interactie met de database";
    responseRedirect = "/forum/uploaden.jsp?message="+message;
    pass = false;
    } catch (Exception e1) { out.println("Error blob1 : "+e1.toString()); };
    } // end pass
    if (pass==true)
    try
    Statement stmt2 = conn.createStatement();
    String insert_empty_blob = "INSERT INTO test_blob(id "+
    ",filename "+
    ",mimetype "+
    ",kb) "+
    "VALUES("+Integer.parseInt(next_id) +
    ",'"+saveFileName+"'"+
    ",'"+mimeType+"'"+
    ","+kb_size+")";
    stmt2.executeQuery(insert_empty_blob);
    conn.commit();
    if (stmt2!= null) {stmt2.close();}else{stmt2.close();pass = false;}
    } catch (Exception e2){
    message = "Uploaden mislukt !...Er ging wat fout tijdens de interactie met de database";
    responseRedirect = "/forum/uploaden.jsp?message="+message;
    out.println("<P>" + "2. There was an error inserting mime type:");}
    } //end pass
    if (pass==true)
    try
    conn.setAutoCommit(false);
    } catch (Exception e3) { pass = false; out.println("Error blob 3: "+e3.toString()); };
    } //end pass
    if (pass==true)
    try
    String Query_blob ="Select test_blob FROM test_blob where id="+next_id+" FOR UPDATE";
    stmt_empty = conn.createStatement();
    rs=stmt_empty.executeQuery(Query_blob);
    } catch (Exception e4) {
    pass = false;
    out.println("Error blob 4: "+e4.toString());
    message = "Uploaden mislukt !...Er ging wat fout tijdens de interactie met de database";
    responseRedirect = "/forum/uploaden.jsp?message="+message;};
    } //end pass
    if (pass==true)
    try
                             if (rs.next())
                             blb = ((OracleResultSet)rs).getBLOB(1);
                        OutputStream stmBlobStream = blb.getBinaryOutputStream();
                             try {
                                  int iSize = blb.getBufferSize();
                             byte[] byBuffer = new byte[iSize];
                             int iLength = -1;
    ByteArrayInputStream stmByteIn = new ByteArrayInputStream(dataBytes2);
                                  try {
    // while ( (iLength = in.read(byBuffer, 0,      iSize)) != -1 )
    while ( (iLength = stmByteIn.read(byBuffer, 0,      iSize)) != -1 )
                                       stmBlobStream.write(byBuffer, 0, iLength);
                                       stmBlobStream.flush();
                                       } // end while
    } catch (Exception e5) {
    pass=false;
    out.println("Error blob 5: "+e5.toString());
    message = "Uploaden mislukt !...Er ging wat fout tijdens de interactie met de database";
    responseRedirect = "/forum/uploaden.jsp?message="+message; }
                                  finally { conn.commit();     }
    } catch (Exception e6) { out.println("Error blob 6: "+e6.toString()); };
                             } //end if rs.next()
                             else {      throw new SQLException("Could not locate message record in database."); }
    } catch (Exception e7) { out.println("Error blob : "+e7.toString()); };
    } // end pass
    } // end pass2
    else //request is not multipart/form-data
    message = "Uploaden mislukt !...Gegevens niet verstuurd via multipart/form-data.";
    responseRedirect = "/forum/error.jsp?message="+message;
    out.println("Request not multipart/form-data.");
    catch(Exception e)
    try
    //print error message to standard out
    out.println("Error in doPost: " + e);
    //send error message to client
    out.println("An unexpected error has occurred.");
    out.println("Error description: " + e);
    }catch (Exception f) {}
    response.sendRedirect(responseRedirect);
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    doPost(request,response);
    Regards
    Martin

  • Af:fileDownloadActionListener picks wrong filename for the first time after row selection.

    Hi,
    I am using Oracle Jdeveloper 11g release 1. In one of my jspx pages i have a table, i can select one of the row and click on a button which invokes fileDownloadActionListener. The code of jspx is as below:
    <af:commandMenuItem text="#{coregccomplianceuiBundle.MENU_EXPORT}"
                                        id="CS19" partialSubmit="true"
                                        actionListener="#{viewScope.core_gccompliance_cs_librarybean.validateExport}"
                                        partialTriggers="CSftLib"
                                        disabled="#{viewScope.core_gccompliance_cs_librarybean.exportDisabled}">
    </af:commandMenuItem>
    <!--This button is set hidden, which is used to deal with the download job.
        The Export button on the page only does the validation. (whether it's a system defined standard)-->
      <af:commandButton text="#{coregccomplianceuiBundle.BTNEXPORTHIDDEN}" id="csl_csExportHidden"
                                          clientComponent="true" visible="false"
                                          partialSubmit="false">
    <af:fileDownloadActionListener contentType="application/x-download" 
                                          method="#{viewScope.core_gccompliance_cs_librarybean.handleExport}"
                                          filename="#{viewScope.core_gccompliance_cs_librarybean.fileName}"/> 
    </af:commandButton>
      /** force the ExportHidden Button to do export */
        function csExportHandler(event) {
            var exportCmd = AdfPage.PAGE.findComponent("emT:CS4:csl_csExportHidden");
            var actionEvent = new AdfActionEvent(exportCmd);
            actionEvent.forceFullSubmit();
            actionEvent.noResponseExpected();
            actionEvent.queue();
    The bean methods used in above block are as below:
    public void validateExport(ActionEvent actionEvent) {
           // checks if entity is system defined and shows error popup if it is .
            if (checkIsSystem())
                return;
            //Handle the export    
            AdfUtil.addScript("csExportHandler()");
    public void handleExport(FacesContext context, OutputStream out) {
            ComplianceLibraryAMImpl am = getDataController();
            HttpServletRequest request =
                (HttpServletRequest)context.getExternalContext().getRequest();
            Locale locale = NLSUtil.getClientLocale(request);
            ResourceBundle rb =
                ResourceBundle.getBundle("oracle.sysman.core.gccompliance.view.CoreGccomplianceUiMsg",
                                         locale);
            PreparedStatement st =
                am.getDBTransaction().createPreparedStatement("commit", 1);
            Connection conn = null;
            boolean isAgentSideCs = false;
            try {
                conn = st.getConnection();
                RichTable oTable = getCsTable();
                fileName = "ComplianceStandard.xml";
                List<Raw> exportGuids = new ArrayList<Raw>();
                for (Object opaqueFacesRowKey : oTable.getSelectedRowKeys()) {
                    oTable.setRowKey(opaqueFacesRowKey);
                    Object o = oTable.getRowData();
                    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
                    exportGuids.add((Raw)rowData.getRow().getAttribute("CsGuid"));
                    int csType = ((oracle.jbo.domain.Number)rowData.getRow().getAttribute("CsType")).intValue();
                    if(csType == 4)
                        fileName =
                                (String)rowData.getRow().getAttribute("CsDname") + ".zip";
                        isAgentSideCs = true;
                    else
                        fileName =
                                (String)rowData.getRow().getAttribute("CsDname") + ".xml";
                    if(((Integer)rowData.getRow().getAttribute("IsSystem")).intValue() == 1){
                        throw(new ParseException(50));
                if (exportGuids.size() > 1)
                    fileName = "Compliancestandard_list.xml";
                RAW guid = new RAW(exportGuids.get(0).toString());
                if(isAgentSideCs)
                    getDataController().exportStandardContent(conn, out, guid);
                else
                    CsExport csexport = new CsExport(false);
                    csexport.doCsExport(conn, guid, false, out);
            } catch (ParseException e) {
                String errMsg = "";
                String errHdr = "";
                if(e.getStatus() == 50){
                    errMsg = rb.getString("ERRMSG_ISSYSTEMENTITY_EXPORT");
                    errHdr = rb.getString("ERRHDR_ISSYSTEMENTITY_EXPORT");
                else{
                    errMsg = rb.getString("ERRMSG_EXPORT_CS");
                    errHdr = rb.getString("ERRHDR_EXPORT_CS");
                AdfUtil.showMessageDialog(null, AdfUtil.MESSAGE_TYPE.ERROR, errHdr,
                                          errMsg, false, null);
                throw new RuntimeException(e);
            } catch (SQLException e) {
                throw new RuntimeException(e);
            } finally {
                JDBCUtil.close(st);
            MimeUtil mimeUtil = new MimeUtil();
            mimeUtil.downloadFile(context, fileName);
            try {
                out.flush();
                out.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
    Class MimeUtil:
    public void downloadFile(FacesContext context, String fileName) {
            HttpServletResponse httpServletResponse =
                (HttpServletResponse)context.getExternalContext().getResponse();
            HttpServletRequest httpServletRequest =
                (HttpServletRequest) context.getExternalContext().getRequest();
            String unicodeFileName = fileName;
            String agent = httpServletRequest.getHeader("USER-AGENT").toLowerCase(Locale.US);
            boolean isIE = false;
            if (null != agent && -1 != agent.indexOf("msie"))
                isIE = true;
            //encode the output file name to support NLS
            unicodeFileName = MimeUtil.encodeFileName(fileName, isIE);
            httpServletResponse.setHeader("Content-disposition",
                                          "attachment;filename=\"" + unicodeFileName +
    httpServletResponse.setContentType("application/x-download");
            context.responseComplete();
            httpServletResponse.setContentType("application/x-download");
            context.responseComplete();
    Now when i come to the page for first time and select a row and click on Export then the filename that gets shown in save file dialog is incorrect (it shows partial adf taskflow name) , but when i select the row again by clicking on any other row and click export it shows correct filename i.e. selectedRowName.zip or .xml according to type of row selected.
    Can anybody suggest what am i missing?

    difficult to tell like this.but better you debug your code then you can get where you getting filename wrong.

  • Warning : PerformRecord.java use uncheck or unsafe operations

    /*When compile (with version 1.5.0_05) have a warnning message
    Note : PerformRecord.java use uncheck or unsafe operations
    Note : Recompile wiht -XLint : uncheck for details
    How can I solve this problem*/
    this is my code :
    import java.sql.*;
    import java.util.*;
    public class PerformRecord
         public static final String DEFAULT_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    public static final String DEFAULT_URL = "Jdbc:Odbc:PersonalODBC";
    public static final String DEFAULT_USERNAME = "Personal";
    public static final String DEFAULT_PASSWORD = "moshan74";
         public Connection conn = null;
         public String querySQL;
         /*==Constructor class== */
         public PerformRecord()
              /*load JDBC driver*/
              try{
                   Class.forName(DEFAULT_DRIVER);
              }catch (ClassNotFoundException e){System.err.println(e.getMessage());}          
         /*===Method class*/
         /*set value for connection var*/
         public void getConnection()
              this.conn = setConnect();
         /*get QuerySQL*/
         public void setQuery(String sql)
              this.querySQL = sql;
         /*open connection */
         public Connection setConnect()
              try{
              conn = DriverManager.getConnection(DEFAULT_URL,DEFAULT_USERNAME,DEFAULT_PASSWORD);               
              }catch (SQLException e){System.err.print(e.getMessage());     }
              return conn;
         /*close connection*/
         public void closeConnect()
    try{
    conn.close();
    }catch (Exception e){ }
         /*execute query statement */
         public Object executeQuery()
              Object returnValue = null;
              try{
                   /*executing query and check result */
                   Statement stmt          = conn.createStatement();               
                   boolean hasResultSet = stmt.execute(querySQL);
                   if (hasResultSet)
                        /*get set of the record*/
                        ResultSet rs               = stmt.getResultSet();
                        /*get set of the column*/
                        ResultSetMetaData meta = rs.getMetaData();
                        /*amount column*/
                        int numColumns = meta.getColumnCount();
                        /*arrayLisst to add data*/     
                        List rows          = new ArrayList();
    while (rs.next())
    Map thisRow = new LinkedHashMap();// 1 element(1 row,i column)
    for (int i = 1; i <= numColumns; ++i)
    String columnName = meta.getColumnName(i);
    Object value = rs.getObject(columnName);
    thisRow.put(columnName, value);
    rows.add(thisRow);
    rs.close();
    stmt.close();
                   this.closeConnect();
    returnValue = rows;
    else
    int updateCount = stmt.getUpdateCount();
    returnValue = new Integer(updateCount);
              }catch (SQLException e){System.err.print(e.getMessage());     }
    return returnValue;
    ps>> I want to to use Generics to help it but I don't know how to do it in the right way . Can you you help me?
    Thanks
    Arunya

    regarding your Map/LinkedHashMap, since you keys are String and you values are Objects... you would define you Map using those two as you data type pair...
    ap<String,Object>thisRow = new LinkedHashMap<String,Object>();and similar for you List/ArrayList where you putting Maps into...
    List<Map<String,Object>> rows = new ArrayList<Map<String,Object>>();for more information on generics read...
    [url http://java.sun.com/docs/books/tutorial/java/javaOO/generics.html]Sun's The Java Tutorial : Generics
    - MaxxDmg...
    - ' He who never sleeps... '

  • Question about running a servelt using HTML form.

    Hi, Im new to Servlets , I have created a servelt with this code :
    package oracle.servlets;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet {
        private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
        private static final String DB_URL = "jdbc:oracle:thin:@localhost:1521:ahmaddb";
        private static final String DB_USERNAME = "fundinfo";
        private static final String DB_PASSWORD = "tadapps";
        private static Connection con;
        private String pass;
        private String name;
    /*init() : invoked by the servlet engine before the servicing of client requests
    - Can be used to retrieve initialization parameters
    – Takes a ServletConfig object as a parameter
    – Is invoked when the servlet instance is created
    – Is useful for obtaining database connections from a connection pool*/
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
            //config.getInitParameter(arg0);
        public void doGet(HttpServletRequest request,
                          HttpServletResponse response) throws ServletException,
                                                               IOException {
    response.setContentType(CONTENT_TYPE);
            //PrintWriter : Print formatted representations of objects to a text-output stream.
            //getWriter() : Returns a PrintWriter object that can send character text to the client.
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head><title>My First Servlet</title></head>");
            out.println("<body>");
            out.println("<p>The servlet has received a GET. This is the reply.</p>");
            out.println("</body></html>");
            out.close();
        public void doPost(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException,
                                                                IOException {
            response.setContentType(CONTENT_TYPE);
            PrintWriter out = response.getWriter();
            name = request.getParameter("user_name");
            pass = request.getParameter("user_password");
            boolean result = verifyPassword(name, pass);
            out.println("<html>");
            out.println("<head><title>LoginServlet</title></head>");
            out.println("<body>");
            if (result == true){
            out.println ("Hello " + name + ": Your login module is working great!");
            else{
            out.println ("Invalid user name or password");
            out.println ("</body></html>");
            out.close();
            // out.println("<p>The servlet has received a POST. This is the reply.</p>");
            //out.println("</body></html>");
            //out.close();
        public void configureConnection() throws SQLException {
        try{
        Class.forName("oracle.jdbc.OracleDriver");
        con = DriverManager.getConnection(DB_URL, DB_USERNAME,DB_PASSWORD);
        con.setAutoCommit(true);
        catch (Exception e){
        System.out.println("Connection failed: " +e.toString());
        public Connection getConnection() throws SQLException
        configureConnection();
        return con;
        protected boolean verifyPassword(String theuser, String password) {
        String originalPassword = null;
        try {
        con = getConnection();
        Statement stmt = con.createStatement();
        stmt.executeQuery("select password from login where uname='"+theuser+"'");
        ResultSet rs = stmt.getResultSet();
        if(rs.next())
        //>>
        originalPassword = rs.getString(1);
        stmt.close();
        if(originalPassword.equals(password)) {
        return true;
        else {
        return false;
        catch (Exception e){
        System.out.println("Exception in verifyPassword()="+e.toString());
        return false;
    }and created an HTML form to target this servlet
    <form action="/loginservlet" method="post">,
    when I enter the the credintials I get this output in the webpage :
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    10.4.5 404 Not Found
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

    Thanks , yes it is added to the web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
        <description>Empty web.xml file for Web Application</description>
        <servlet>
            <servlet-name>LoginServlet</servlet-name>
            <servlet-class>oracle.servlets.LoginServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>LoginServlet</servlet-name>
            <url-pattern>/loginservlet</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>35</session-timeout>
        </session-config>
        <mime-mapping>
            <extension>html</extension>
            <mime-type>text/html</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>txt</extension>
            <mime-type>text/plain</mime-type>
        </mime-mapping>
    </web-app>Anymore suggestions?

Maybe you are looking for

  • Sql server agent roles and job's owner issue

    Hi, We have a tricky question about agent role and job owner. If I granted sqlagentoperatorrole to a windows account in a sql instance, the account will have permission to create a sql job, the job's owner is the account and he can edit the job. But

  • ITunes settings lost on every Windows 8 reboot

    I have a Windows 8 laptop and I am using iTunes 64bit version. This problem occured in the previous version and the newly released 11.0.5.5. Every day I properly close all open programs and shutdown. When I reboot the next day, I open iTunes to annoy

  • Document Output - PDF-based forms - output log (error)

    Hello, Ever since activating the PDF-based form for BUS2201 the following error shows via viewing the 'output log': E     Business AddIn Was Not Called     http://srm7.atosorigin-ica.com:80/sap/ebp/docserver?msgdocuget&MsgId=SPPF_MEDIA&MsgNo=038&Lang

  • Webpage using host name without domain

    Installed 10g successfully but when I try to naviagte the url is only using the computer host name without the domain. I keep getting the DNS_ERROR. If I manually append the domain in the webpage it works. Installed on Solaris 10.

  • My computer isn't recoginzing that I have a built in camera.

    I know something LIKE this has been posted many different times, but I've tried many different things, and nothing seems to be working. I just got my MacBookPro two-weeks ago. Everything was running up and well, until two nights ago. I was trying to