Database Connection to AWT and Swings

How do we provide database connection to AWT and swing components?
Is their any possibility to create database connection?
Thanks in advance

Just create an independent DAO class which does all the database/JDBC tasks.
Then use this DAO class as you use every other class in your AWT/Swing application.

Similar Messages

  • Why is HeadlessException explicitly thrown in AWT and swing?

    Hi there,
    I just noticed that HeadlessException is explicitly thrown in some of the constructors in AWT and swing components since J2SE 1.4.
    Given that it's a RuntimeException (unchecked) it doesn't need to be included in the throws clause of the method or constructor.
    There also seems to be inconsistent application of it and inconsistent documentation in the javadoc comments.
    Is this a work in progress or did some refactoring go wrong?

    Most probably IE security settings preventing the js file to be executed. Replied in your other post:
    Unable to get property 'style' of undefined or null reference in sp.ui.dialog.debug.js
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • Lighter Java GUI than awt and swing?

    I had recently came across a company website (http://www.bambookit.com) where they developed a java gui library without using awt and swing (seems to what they claim). And on top of that it uses xml to generate the gui components (they call widgets) and the whole library size is only 95kb and supports java 1.1.x and above. Their demos on the applets loads super fast, never know/experience that java applets can actually be this quick. But this confuses me, how is it possible to develop a gui alternative to awt with the basic java classes and no dependency on awt? But since the applets are awt based, it means that they must have some dependencies.
    This is an extract from their website (that it seemed they did not use awt)
    "Java has a fundamental flaw in its paint thread that made it very difficult to build extremely large applications without getting severe performance and resource penalties (This affects both AWT and Swing based applications). It�s main repaint queue\thread when assigning paint regions to various controls uses the Graphics objects to �clip� them. On a Sun Solaris machine this does not cause any problems, however on a windows machine each Graphics object consumes a system resource/handle, (a limit of around 16,000 exists on Win 95 and Win 98 machines). Each Bitmap image, each font object, each icon consumes a single system resource or handle. If a full repaint is performed on an application containing 1000 controls, it would consume at LEAST 1000 system resource handles. If the application was updated many times a second, lets say 10 times a second, then that equates to 10,000 handles a second. This is not taking into account labels within controls, the various fonts styles and sizes created, the various images that get loaded. This could easily exceed 20,000 system resource requests a second. Bambookit on the other hand utilizes the clip routines and passes along a SINGLE Graphics objects to all its various controls. This alone is a HUGE savings in system resources and performance."
    Two questions came to my mind:
    1) Is it possible to build applet gui without using awt and swing in java? If so the only way to do is to use JNI calls?
    2) Am I wrong in interpreting www.bambookit.com's message that they are not using awt?
    Any comments about this?
    Regards,
    Stanly

    They use AWT as basis for their drawing-layer, as any other lightweight toolkits too.
    If you just want a very fast & light alternative to swing/awt have a look at www.lwvcl.com !
    I use it for a large applet-applikation that has to be java-1.1 compatible. It was a horor when using AWT which was implemented different over all JVMs available and very slow (although native widgets were used).
    With lwvcl (which has only 150kB!) I can use state of the art applets that work very fast on modern jvms like 1.4, give me the ability to compile my applikation to native code using GCJ (using the swt-prt of the library) or distribute it to old-school 1.1 browser where it also runs quite fine...
    Its free for GPL and very cheap for commercial use.
    lg Clemens

  • When using the Database Connectivity Toolset, reads and writes with long binary fields are incompatible.

    I am trying to write LabVIEW Variants to long binary fields in a .mdb file using the Database Connectivity Toolset. I get errors when trying to convert the field back to a variant after reading it back from the database.
    I next tried flattening the variant before writing it and ultimately wound up doing the following experiments:
    1) If I use DB Tools Insert Data to write an ordinary string and read it back using a DB Tools Select Data, the string is converted from ASCII to Unicode.
    2) If I use DB Tools Create Parameterized Query to do an INSERT INTO or an UPDATE operation, specifying that the data is BINARY, then read it back using a DB Tools Select Data,
    the length of the string is prepended to the string itself as a big-endian four-byte integer.
    I can't think of any way to do a parameterized read, although the mechanism exists to return data via parameters.
    Presuming that this same problem affects Variants when they are written to the database and read back, I could see why I get an error. At least with flattened strings I have the option of discarding the length bytes from the beginning of the string.
    Am I missing something here?

    David,
    You've missed the point. When a data item is flattened to a string, the first four bytes of the string are expected to be the total length of the string in big-endian binary format. What is happening here is that preceding this four-byte length code is another copy of the same four bytes. If an ordinary string, "abcdefg" is used in place of the flattened data item, it will come back as <00><00><00><07>abcdefg. Here I've used to represent a byte in hexadecimal notation. This problem has nothing to do with flattening and unflattening data items. It has only to do with the data channel consisting of writing to and reading from the database.
    I am attaching three files that you can use to demonstrate the problem. The VI file c
    ontains an explanation of the problem and instructions for installing and operating the demonstration.
    Ron Martin
    Attachments:
    TestLongBinaryFields.vi ‏132 KB
    Sample.UDL ‏1 KB
    Sample.mdb ‏120 KB

  • Database connection with JRC and CR Viewer version

    Hi,
    I'm upgrading Crystalreportviewer11 to Crystalreportviewer115. I know, I need this directories: WEB_INF\Lib, WEB-INF\Classes and Crystalreportviewer115.
    Crystalreportviewer115 I take from C:\Program Files\Business Objects\common\3.5\ Crystalreportsviewer115. There is file CrConfig.xml (CrystalreportEngine.xml) in Program Files\Common Files\Business Objects\3.5\java. This file belongs to WEB-INF\Classes. But I don't know the path to find .jar files (.jar files belong to WEB_INF\Lib).
    My context.xml looks:
    My web.xml looks:
    name_appl
    Zobrazeni reportu
    crystal_image_uri
    crystalreportviewers115
    My CrystalreportEngine.xml looks:
    ../../../E3/Reports_CR11
    10
    B6W64-010S200-000KA2W-8WT1
    In this code I changed version of crystalreportviewer, other is the same. I don't know, if I should change the keycode too. This keycode was used for Crystalreportviewer11. Is it the same for Crystalreportsviewer115 or different?
    I deployed my directory WebReports to Tomcat (by Tomcat Manager). The variables are Context Path= /CRV and Configuration file URL= file:C:\WebReports\context.xml. The deploying was succesful. Then I set in Tomcat administration tool the jdbc connection. (Tomcat Server -> Service (Catalina) -> Host (localhost) -> Context (/CRV) -> Resources -> Environment Entries and Environment Entry Actions on the right tab)
    I set Name= jdbc/INFO, Type= java.lang.String, Value=
    !oracle.jdbc.driver.OracleDriver!jdbc:oracle:thin:{userid}/{ password}}@{server}:{port}:{oracle instance name}. I saved changes and commited them.I restarted Apache Tomcat service.
    I run the report. It always open a new database connection. I check user ID and password, click OK. But the report isn't running, i can't see this report in CR Viewer. But I see Database Logon screen again. Where is a problem?
    What can I set up in Tomcat administration tool yet?
    Have you some tips for upgrading CR Viewer11 to 115?
    Regards,
    Veronika

    Thank you for your answer.Please, do you know, where should I search all new .jar files? (for my WEB-INF/lib directory).
    My last logs (after running report and connection) look:
    admin log:
    +30.10.2007 14:36:22 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:36:22 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:36:22 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Globally Administer Data Sources
    +30.10.2007 14:37:52 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:37:52 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Tree expand/contract on Catalina:type=Service,serviceName=Catalina
    +30.10.2007 14:37:52 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Found Node: Catalina:type=Service,serviceName=Catalina
    +30.10.2007 14:37:53 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:37:53 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Tree expand/contract on Catalina:type=Host,host=localhost
    +30.10.2007 14:37:53 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Found Node: Catalina:type=Host,host=localhost
    +30.10.2007 14:37:55 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:37:55 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Tree expand/contract on Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:37:55 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Found Node: Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:38:00 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:38:00 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:38:00 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Context Environment Entries Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:38:23 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:38:23 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:38:23 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Globally Administer Data Sources
    +30.10.2007 14:38:37 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:38:37 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:38:37 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:38:40 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:38:40 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:38:40 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Context Environment Entries Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:38:50 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:38:50 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:38:50 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Context Data Sources Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:41:04 org.apache.catalina.core.ApplicationContext log+
    SEVERE: action: Error invoking operation addResource
    javax.management.RuntimeOperationsException: Exception invoking method addResource
    +     at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:511)+
    +     at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(Unknown Source)+
    +     at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(Unknown Source)+
    +     at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)+
    +     at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)+
    +     at org.apache.webapp.admin.resources.SaveDataSourceAction.execute(SaveDataSourceAction.java:178)+
    +     at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)+
    +     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)+
    +     at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1192)+
    +     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:430)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)+
    +     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)+
    +     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)+
    +     at org.apache.webapp.admin.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:123)+
    +     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)+
    +     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)+
    +     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)+
    +     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)+
    +     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)+
    +     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)+
    +     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)+
    +     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)+
    +     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)+
    +     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)+
    +     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)+
    +     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)+
    +     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)+
    +     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)+
    +     at java.lang.Thread.run(Unknown Source)+
    Caused by: java.lang.NullPointerException
    +     at org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:846)+
    +     at org.apache.catalina.mbeans.NamingResourcesMBean.addResource(NamingResourcesMBean.java:230)+
    +     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)+
    +     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)+
    +     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)+
    +     at java.lang.reflect.Method.invoke(Unknown Source)+
    +     at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:501)+
    +     ... 29 more+
    +30.10.2007 14:47:06 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Entered TreeControlTestAction:perform()
    +30.10.2007 14:47:06 org.apache.catalina.core.ApplicationContext log+
    INFO: action: tree param is null
    +30.10.2007 14:47:06 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Select event on Context Environment Entries Catalina:j2eeType=WebModule,name=//localhost/CRV,J2EEApplication=none,J2EEServer=none
    +30.10.2007 14:50:24 org.apache.catalina.core.ApplicationContext log+
    INFO: action: Debugging -- changes saved to conf/server.xml
    catalina log
    +31.10.2007 8:22:31 org.apache.coyote.http11.Http11Protocol init+
    INFO: Initializing Coyote HTTP/1.1 on http-8200
    +31.10.2007 8:22:31 org.apache.catalina.startup.Catalina load+
    INFO: Initialization processed in 1141 ms
    +31.10.2007 8:22:32 org.apache.catalina.core.StandardService start+
    INFO: Starting service Catalina
    +31.10.2007 8:22:32 org.apache.catalina.core.StandardEngine start+
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    +31.10.2007 8:22:32 org.apache.catalina.core.StandardHost start+
    INFO: XML validation disabled
    +31.10.2007 8:22:35 org.apache.coyote.http11.Http11Protocol start+
    INFO: Starting Coyote HTTP/1.1 on http-8200
    +31.10.2007 8:22:35 org.apache.jk.common.ChannelSocket init+
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    +31.10.2007 8:22:35 org.apache.jk.server.JkMain start+
    INFO: Jk running ID=0 time=0/30  config=null
    +31.10.2007 8:22:35 org.apache.catalina.storeconfig.StoreLoader load+
    INFO: Find registry server-registry.xml at classpath resource
    +31.10.2007 8:22:35 org.apache.catalina.startup.Catalina start+
    INFO: Server startup in 3846 ms
    host - manager log is empty
    jacarta service log
    +[2007-10-30 08:32:20] [info] Running Service...+
    +[2007-10-30 08:32:20] [info] Starting service...+
    +[2007-10-30 08:32:22] [info] Service started in 1992 ms.+
    +[2007-10-30 10:29:40] [info] Service STOP signaled+
    +[2007-10-30 10:29:40] [info] Stopping service...+
    +[2007-10-30 10:29:43] [info] Service stopped.+
    +[2007-10-30 10:29:43] [info] Run service finished.+
    +[2007-10-30 10:29:43] [info] Procrun finished.+
    +[2007-10-30 10:29:49] [info] Running Service...+
    +[2007-10-30 10:29:49] [info] Starting service...+
    +[2007-10-30 10:29:50] [info] Service started in 1672 ms.+
    +[2007-10-30 11:10:11] [info] Service STOP signaled+
    +[2007-10-30 11:10:11] [info] Stopping service...+
    +[2007-10-30 11:10:13] [info] Service stopped.+
    +[2007-10-30 11:10:13] [info] Run service finished.+
    +[2007-10-30 11:10:13] [info] Procrun finished.+
    +[2007-10-30 11:10:16] [info] Running Service...+
    +[2007-10-30 11:10:16] [info] Starting service...+
    +[2007-10-30 11:10:17] [info] Service started in 1321 ms.+
    +[2007-10-30 11:23:33] [info] Service STOP signaled+
    +[2007-10-30 11:23:33] [info] Stopping service...+
    +[2007-10-30 11:23:34] [info] Service stopped.+
    +[2007-10-30 11:23:34] [info] Run service finished.+
    +[2007-10-30 11:23:34] [info] Procrun finished.+
    +[2007-10-30 11:23:38] [info] Running Service...+
    +[2007-10-30 11:23:38] [info] Starting service...+
    +[2007-10-30 11:23:39] [info] Service started in 1261 ms.+
    +[2007-10-30 14:50:27] [info] Service STOP signaled+
    +[2007-10-30 14:50:27] [info] Stopping service...+
    +[2007-10-30 14:50:28] [info] Service stopped.+
    +[2007-10-30 14:50:28] [info] Run service finished.+
    +[2007-10-30 14:50:28] [info] Procrun finished.+
    +[2007-10-30 14:50:33] [info] Running Service...+
    +[2007-10-30 14:50:33] [info] Starting service...+
    +[2007-10-30 14:50:34] [info] Service started in 1271 ms.+
    +[2007-10-30 15:11:53] [info] Service STOP signaled+
    +[2007-10-30 15:11:53] [info] Stopping service...+
    +[2007-10-30 15:11:55] [info] Service stopped.+
    +[2007-10-30 15:11:55] [info] Run service finished.+
    +[2007-10-30 15:11:55] [info] Procrun finished.+
    +[2007-10-30 15:12:01] [info] Running Service...+
    +[2007-10-30 15:12:01] [info] Starting service...+
    +[2007-10-30 15:12:02] [info] Service started in 1281 ms.+
    +[2007-10-30 15:13:44] [info] Service STOP signaled+
    +[2007-10-30 15:13:44] [info] Stopping service...+
    +[2007-10-30 15:13:46] [info] Service stopped.+
    +[2007-10-30 15:13:46] [info] Run service finished.+
    +[2007-10-30 15:13:46] [info] Procrun finished.+
    +[2007-10-30 15:13:48] [info] Running Service...+
    +[2007-10-30 15:13:48] [info] Starting service...+
    +[2007-10-30 15:13:50] [info] Service started in 1291 ms.+
    +[2007-10-30 15:57:49] [info] Console SHUTDOWN event signaled+
    +[2007-10-30 15:57:49] [info] Stopping service...+
    +[2007-10-30 15:57:50] [info] Service stopped.+
    +[2007-10-30 15:57:50] [info] Run service finished.+
    +[2007-10-30 15:57:50] [info] Procrun finished.+
    localhost log
    +30.10.2007 8:32:31 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    +30.10.2007 9:39:30 org.apache.catalina.core.StandardWrapperValve invoke+
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
    +     at org.apache.jsp.param_jsp._jspService(org.apache.jsp.param_jsp:61)+
    +     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)+
    +     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)+
    +     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)+
    +     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)+
    +     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)+
    +     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)+
    +     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)+
    +     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)+
    +     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)+
    +     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)+
    +     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)+
    +     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)+
    +     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)+
    +     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)+
    +     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)+
    +     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)+
    +     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)+
    +     at java.lang.Thread.run(Unknown Source)+
    +30.10.2007 10:29:56 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    +30.10.2007 11:10:20 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    +30.10.2007 11:23:42 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    +30.10.2007 14:45:58 org.apache.catalina.core.StandardWrapperValve invoke+
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
    +     at org.apache.jsp.param_jsp._jspService(org.apache.jsp.param_jsp:61)+
    +     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)+
    +     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)+
    +     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)+
    +     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)+
    +     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)+
    +     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)+
    +     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)+
    +     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)+
    +     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)+
    +     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)+
    +     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)+
    +     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)+
    +     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)+
    +     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)+
    +     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)+
    +     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)+
    +     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)+
    +     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)+
    +     at java.lang.Thread.run(Unknown Source)+
    +30.10.2007 14:50:40 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    +30.10.2007 15:12:08 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    +30.10.2007 15:13:52 org.apache.catalina.core.ApplicationContext log+
    +INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]+
    stderr log
    +30.10.2007 8:32:23 org.apache.coyote.http11.Http11Protocol init+
    INFO: Initializing Coyote HTTP/1.1 on http-8200
    +30.10.2007 8:32:23 org.apache.catalina.startup.Catalina load+
    INFO: Initialization processed in 1392 ms
    +30.10.2007 8:32:23 org.apache.catalina.core.StandardService start+
    INFO: Starting service Catalina
    +30.10.2007 8:32:23 org.apache.catalina.core.StandardEngine start+
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    +30.10.2007 8:32:23 org.apache.catalina.core.StandardHost start+
    INFO: XML validation disabled
    +30.10.2007 8:32:31 org.apache.coyote.http11.Http11Protocol start+
    INFO: Starting Coyote HTTP/1.1 on http-8200
    +30.10.2007 8:32:32 org.apache.jk.common.ChannelSocket init+
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    +30.10.2007 8:32:32 org.apache.jk.server.JkMain start+
    INFO: Jk running ID=0 time=0/210  config=null
    +30.10.2007 8:32:32 org.apache.catalina.storeconfig.StoreLoader load+
    INFO: Find registry server-registry.xml at classpath resource
    +30.10.2007 8:32:32 org.apache.catalina.startup.Catalina start+
    INFO: Server startup in 9113 ms
    +30.10.2007 10:29:40 org.apache.coyote.http11.Http11Protocol pause+
    INFO: Pausing Coyote HTTP/1.1 on http-8200
    +30.10.2007 10:29:41 org.apache.catalina.core.StandardService stop+
    INFO: Stopping service Catalina
    +30.10.2007 10:29:43 org.apache.coyote.http11.Http11Protocol destroy+
    INFO: Stopping Coyote HTTP/1.1 on http-8200
    +30.10.2007 10:29:51 org.apache.coyote.http11.Http11Protocol init+
    INFO: Initializing Coyote HTTP/1.1 on http-8200
    +30.10.2007 10:29:51 org.apache.catalina.startup.Catalina load+
    INFO: Initialization processed in 1281 ms
    +30.10.2007 10:29:51 org.apache.catalina.core.StandardService start+
    INFO: Starting service Catalina
    +30.10.2007 10:29:51 org.apache.catalina.core.StandardEngine start+
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    +30.10.2007 10:29:51 org.apache.catalina.core.StandardHost start+
    INFO: XML validation disabled
    +30.10.2007 10:29:56 org.apache.catalina.session.StandardManager doLoad+
    SEVERE: IOException while loading persisted sessions: java.io.IOException: Unable to recover report source
    java.io.IOException: Unable to recover report source
    +     at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.readExternal(Unknown Source)+
    +     at java.io.ObjectInputStream.readExternalData(Unknown Source)+
    +     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)+
    +     at java.io.ObjectInputStream.readObject0(Unknown Source)+
    +     at java.io.ObjectInputStream.readObject(Unknown Source)+
    +     at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1371)+
    +     at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:903)+
    +     at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:393)+
    +     at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)+
    +     at org.apache.catalina.session.StandardManager.start(StandardManager.java:634)+
    +     at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)+
    +     at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:391)+
    +     at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1042)+
    +     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:255)+
    +     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)+
    +     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4053)+
    +     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)+
    +     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)+
    +     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)+
    +     at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:589)+
    +     at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:536)+
    +     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)+
    +     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)+
    +     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)+
    +     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)+
    +     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)+
    +     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)+
    +     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)+
    +     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)+
    +     at org.apache.catalina.core.StandardService.start(StandardService.java:450)+
    +     at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)+
    +     at org.apache.catalina.startup.Catalina.start(Catalina.java:537)+
    +     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)+
    +     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)+
    +     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)+
    +     at java.lang.reflect.Method.invoke(Unknown Source)+
    +     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)+
    +     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)+
    +30.10.2007 10:29:56 org.apache.catalina.session.StandardManager start+
    SEVERE: Exception loading sessions from persistent storage
    java.io.IOException: Unable to recover report source
    +     at com.crystaldecisions.reports.reportengineinterface.JPEReportSource.readExternal(Unknown Source)+
    +     at java.io.ObjectInputStream.readExternalData(Unknown Source)+
    +     at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)+
    +     at java.io.ObjectInputStream.readObject0(Unknown Source)+
    +     at java.io.ObjectInputStream.readObject(Unknown Source)+
    +     at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1371)+
    +     at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:903)+
    +     at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:393)+
    +     at org.apache.catalina.session.StandardManager.load(StandardManager.java:320)+
    +     at org.apache.catalina.session.StandardManager.start(StandardManager.java:634)+
    +     at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:431)+
    +     at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:391)+
    +     at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1042)+
    +     at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:255)+
    +     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)+
    +     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4053)+
    +     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)+
    +     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)+
    +     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)+
    +     at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:589)+
    +     at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:536)+
    +     at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:471)+
    +     at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1102)+
    +     at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)+
    +     at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)+
    +     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)+
    +     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)+
    +     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)+
    +     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)+
    +     at org.apache.catalina.core.StandardService.start(StandardService.java:450)+
    +     at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)+
    +     at org.apache.catalina.startup.Catalina.start(Catalina.java:537)+
    +     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)+
    +     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)+
    +     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)+
    +     at java.lang.reflect.Method.invoke(Unknown Source)+
    +     at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)+
    +     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)+
    +30.10.2007 10:29:57 org.apache.coyote.http11.Http11Protocol start+
    INFO: Starting Coyote HTTP/1.1 on http-8200
    +30.10.2007 10:29:57 org.apache.jk.common.ChannelSocket init+
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    +30.10.2007 10:29:57 org.apache.jk.server.JkMain start+
    INFO: Jk running ID=0 time=0/60  config=null
    +30.10.2007 10:29:57 org.apache.catalina.storeconfig.StoreLoader load+
    INFO: Find registry server-registry.xml at classpath resource
    +30.10.2007 10:29:57 org.apache.catalina.startup.Catalina start+
    INFO: Server startup in 5979 ms
    +30.10.2007 11:10:03 org.apache.catalina.core.StandardContext reload+
    INFO: Reloading this Context has started
    +30.10.2007 11:10:11 org.apache.coyote.http11.Http11Protocol pause+
    INFO: Pausing Coyote HTTP/1.1 on http-8200
    +30.10.2007 11:10:13 org.apache.catalina.core.StandardService stop+
    INFO: Stopping service Catalina
    +30.10.2007 11:10:13 org.apache.coyote.http11.Http11Protocol destroy+
    INFO: Stopping Coyote HTTP/1.1 on http-8200
    +30.10.2007 11:10:18 org.apache.coyote.http11.Http11Protocol init+
    INFO: Initializing Coyote HTTP/1.1 on http-8200
    +30.10.2007 11:10:18 org.apache.catalina.startup.Catalina load+
    INFO: Initialization processed in 1162 ms
    +30.10.2007 11:10:18 org.apache.catalina.core.StandardService start+
    INFO: Starting service Catalina
    +30.10.2007 11:10:18 org.apache.catalina.core.StandardEngine start+
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    +30.10.2007 11:10:18 org.apache.catalina.core.StandardHost start+
    INFO: XML validation disabled
    +30.10.2007 11:10:20 org.apache.coyote.http11.Http11Protocol start+
    INFO: Starting Coyote HTTP/1.1 on http-8200
    +30.10.2007 11:10:21 org.apache.jk.common.ChannelSocket init+
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    +30.10.2007 11:10:21 org.apache.jk.server.JkMain start+
    INFO: Jk running ID=0 time=0/80  config=null
    +30.10.2007 11:10:21 org.apache.catalina.storeconfig.StoreLoader load+
    INFO: Find registry server-registry.xml at classpath resource
    +30.10.2007 11:10:21 org.a

  • Differences between awt and swing

    Ive written the following code, however Ive implemented the gui in awt rather then swing. Ive been told it hs too be in swing. What is the difference between swing and awt what will I need to change in my program so that its done using swing rather then the awt? Heres the code:
    // pp.java
    // Grant Brown
    // 22/02/02
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    // =========================================================
    // Class: pp
    // This class drives the customer manager. It contains the
    // main method which gets called as soon as this application
    // begins to run.
    // =========================================================
    class pp extends Frame implements ActionListener
    // Container of customer objects
    private Vector customers = new Vector (100);
    // List of names component. (Must specify java.awt in
    // front of List to distinguish the List class in the
    // java.awt package from the List class in the java.util
    // package.)
    private java.awt.List names = new java.awt.List ();
    // Delete and update button components.
    private Button delete;
    private Button update;
    // Default constructor.
    public pp ()
    // Assign "Paper Round Manager" to title bar of frame window.
    super ("Paper Round Manager");
    // Add a listener that responds to window closing
    // events. When this event occurs (by clicking on the
    // close box in the title bar), save customers and exit.
    addWindowListener (new WindowAdapter ()
    public void windowClosing
    (WindowEvent e)
    saveCustomers ();
    System.exit (0);
    // Place an empty label in the north part of the frame
    // window. This is done to correct an AWT positioning
    // problem.
    Label l = new Label ();
    add ("North", l);
    // Place the names component in the center part of the
    // frame window.
    add ("Center", names);
    // Create a panel object to hold four buttons.
    Panel p = new Panel ();
    Button b;
    // Add an Insert button to the Panel object and register
    // the current pp object as a listener for button events.
    p.add (b = new Button ("Insert"));
    b.addActionListener (this);
    // Add a Delete button to the Panel object and register
    // the current pp object as a listener for button events.
    p.add (delete = new Button ("Delete"));
    delete.addActionListener (this);
    // The Delete button should be disabled until there is at
    // least one customer to delete.
    delete.setEnabled (false);
    // Add an Update button to the Panel object and register
    // the current pp object as a listener for button events.
    p.add (update = new Button ("Update"));
    update.addActionListener (this);
    // The Update button should be disabled until there is at
    // least one customer to update.
    update.setEnabled (false);
    // Add a Finish button to the Panel object and register
    // the current customer object as a listener for button events.
    p.add (b = new Button ("Finish"));
    b.addActionListener (this);
    // Add the panel object to the frame window container.
    add ("South", p);
    // Set the background of the frame window container to
    // lightGray
    setBackground (Color.lightGray);
    // Set the size of the frame window container to 400
    // pixels horizontally by 200 pixels vertically.
    setSize (400, 200);
    // Allow the user to resize the frame window.
    setResizable (true);
    // Load all contacts.
    loadCustomers ();
    // Make sure that the frame window is visible.
    setVisible (true);
    public void actionPerformed (ActionEvent e)
    if (e.getActionCommand ().equals ("Delete"))
    delete ();
    else
    if (e.getActionCommand ().equals ("Finish"))
    saveCustomers ();
    System.exit (0);
    else
    if (e.getActionCommand ().equals ("Insert"))
    insert ();
    else
    update ();
    public Insets getInsets ()
    // Return an Insets object that describes the number of
    // pixels to reserve as a border around the edges of the
    // frame window.
    return new Insets (10, 10, 10, 10);
    public static void main (String [] args)
    // Create a new pp object and let it do its thing.
    new pp ();
    private void delete ()
    // Obtain index of selected contact item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a contact if no contact item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Remove the contact item from the names component.
    names.remove (index);
    // Remove the Customer object from the contacts Vector
    // object.
    customers.remove (index);
    // If there are no more customers ...
    if (customers.size () == 0)
    delete.setEnabled (false);
    update.setEnabled (false);
    else
    // Make sure that the first contact item in the names
    // list is highlighted.
    names.select (0);
    private void insert ()
    // Create an Insert data entry form to enter information
    // for a new customer.
    DataEntryForm def = new DataEntryForm (this, "Insert");
    // If the bOk Boolean flag is set, this indicates the user
    // exited the form by pressing the Ok button.
    if (def.bOk)
    // Create a Contact object and assign information from
    // the form to its fields.
    Customer temp = new Customer ();
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.round = new String (def.round.getText ());
    temp.address = new String (def.address.getText ());
    temp.phone = new String (def.phone.getText ());
    // Add a new customer item to the names component.
    names.add (temp.name + ", " + temp.publication);
    // Add the Customer object to the contacts Vector
    // object.
    customers.add (temp);
    // Make sure that the Delete and Update buttons are
    // enabled.
    delete.setEnabled (true);
    update.setEnabled (true);
    // Destroy the dialouge box.
    def.dispose ();
    // Make sure that the first customer item in the names list
    // is highlighted.
    names.select (0);
    // ===========================================================
    // Load all contacts from contacts.dat into the contacts
    // Vector object. Also, make sure that the last name/first
    // name from each contact is combined into a String object and
    // inserted into the names component - as a contact item.
    // ===========================================================
    private void loadCustomers ()
    FileInputStream fis = null;
    try
    fis = new FileInputStream ("Customers.dat");
    DataInputStream dis = new DataInputStream (fis);
    int nCustomers = dis.readInt ();
    for (int i = 0; i < nCustomers; i++)
    Customer temp = new Customer ();
    temp.name = dis.readUTF ();
    temp.publication = dis.readUTF ();
    temp.round = dis.readUTF ();
    temp.address = dis.readUTF ();
    temp.phone = dis.readUTF ();
    names.add (temp.name + ", " + temp.publication);
    customers.add (temp);
    if (nCustomers > 0)
    delete.setEnabled (true);
    update.setEnabled (true);
    catch (IOException e)
    finally
    if (fis != null)
    try
    fis.close ();
    catch (IOException e) {}
    // Make sure that the first contact item in the names list
    // is highlighted.
    names.select (0);
    // ========================================================
    // Save all Customer objects from the customer Vector object
    // to customer.dat. The number of customerss are saved as an
    // int to make it easy for loadCustomers () to do its job.
    // ========================================================
    private void saveCustomers ()
    FileOutputStream fos = null;
    try
    fos = new FileOutputStream ("customers.dat");
    DataOutputStream dos = new DataOutputStream (fos);
    dos.writeInt (customers.size ());
    for (int i = 0; i < customers.size (); i++)
    Customer temp = (Customer) customers.elementAt (i);
    dos.writeUTF (temp.name);
    dos.writeUTF (temp.publication);
    dos.writeUTF (temp.round);
    dos.writeUTF (temp.address);
    dos.writeUTF (temp.phone);
    catch (IOException e)
    MsgBox mb = new MsgBox (this, "PP Error",
    e.toString ());
    mb.dispose ();
    finally
    if (fos != null)
    try
    fos.close ();
    catch (IOException e) {}
    private void update ()
    // Obtain index of selected customer item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a customer if no customer item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Obtain a reference to the customer object (from the
    // customers Vector object) that is associated with the
    // index.
    Customer temp = (Customer) customers.elementAt (index);
    // Create and display an update entry form.
    DataEntryForm def = new DataEntryForm (this, "Update",
    temp.name,
    temp.publication,
    temp.round,
    temp.address,
    temp.phone);
    // If the user pressed Ok...
    if (def.bOk)
    // Update the customer information in the customers
    // Vector object.
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.round = new String (def.round.getText ());
    temp.address = new String (def.address.getText ());
    temp.phone = new String (def.phone.getText ());
    // Make sure the screen reflects the update.
    names.replaceItem (temp.name + ", " + temp.publication,
    index);
    // Destroy the dialouge box.
    def.dispose ();
    // Make sure that the first customer item in the names
    // list is highlighted.
    names.select (0);

    Ive doen pretty much what you said burt now my program isnt working at all. The window comes up but instead of doing something when you click the button it just throws shit loads of exceptions. Heres my abridged code
    // pp.java
    // Grant Brown
    // 22/02/02
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    import javax.swing.*;
    // =========================================================
    // Class:PP
    // This class drives the Paper Round manager. It contains the
    // main method which gets called as soon as this application
    // begins to run.
    // =========================================================
    class pp extends JFrame implements ActionListener
    // Container of customer objects (one object per customer)
    private Vector customers = new Vector (100);
    // List of names component. (Must specify java.awt in
    // front of List to distinguish the List class in the
    // java.awt package from the List class in the java.util
    // package.)
    private java.awt.List names = new java.awt.List ();
    // Delete and update button components.
    private JButton delete;
    private JButton update;
    // Default constructor.
    public pp ()
    // Assign Contact Manager to title bar of frame window.
    super ("Paper Round Manager");
    // Add a listener that responds to window closing
    // events. When this event occurs (by clicking on the
    // close box in the title bar), save contacts and exit.
    addWindowListener (new WindowAdapter ()
    public void windowClosing
    (WindowEvent e)
    saveCustomers ();
    System.exit (0);
    // Place an empty label in the north part of the frame
    // window. This is done to correct an AWT positioning
    // problem. (One thing that you'll come to realize as
    // you work with the AWT is that there are lots of bugs.)
    JLabel l = new JLabel ();
    getContentPane().add ("North", l);
    // Place the names component in the center part of the
    // frame window.
    getContentPane().add ("Center", names);
    // Create a panel object to hold four buttons.
    JPanel p = new JPanel ();
    JButton b;
    // Add an Insert button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (b = new JButton ("Insert"));
    b.addActionListener (this);
    // Add a Delete button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (delete = new JButton ("Delete"));
    delete.addActionListener (this);
    // The Delete button should be disabled until there is at
    // least one contact to delete.
    delete.setEnabled (false);
    // Add an Update button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (update = new JButton ("Update"));
    update.addActionListener (this);
    // The Update button should be disabled until there is at
    // least one contact to update.
    update.setEnabled (false);
    // Add a Finish button to the Panel object and register
    // the current cm object as a listener for button events.
    p.add (b = new JButton ("Finish"));
    b.addActionListener (this);
    // Add the panel object to the frame window container.
    getContentPane().add ("South", p);
    // Set the background of the frame window container to
    // lightGray (to give a pleasing effect).
    setBackground (Color.lightGray);
    // Set the size of the frame window container to 400
    // pixels horizontally by 200 pixels vertically.
    setBounds (50, 100, 400, 200);
    // Do not allow the user to resize the frame window.
    loadCustomers ();
    // Load all contacts.
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // Make sure that the frame window is visible.
    setVisible (true);
    public void actionPerformed (ActionEvent e)
    if (e.getActionCommand ().equals ("Delete"))
    delete ();
    else
    if (e.getActionCommand ().equals ("Finish"))
    saveCustomers ();
    System.exit (0);
    else
    if (e.getActionCommand ().equals ("Insert"))
    insert ();
    else
    update ();
    public Insets getInsets ()
    // Return an Insets object that describes the number of
    // pixels to reserve as a border around the edges of the
    // frame window.
    return new Insets (10, 10, 10, 10);
    public static void main (String [] args)
    // Create a new cm object and let it do its thing.
    new pp ();
    private void delete ()
    // Obtain index of selected customer item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a contact if no contact item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Remove the customer item from the names component.
    names.remove (index);
    // Remove the Customer object from the contacts Vector
    // object.
    customers.remove (index);
    // If there are no more customers ...
    if (customers.size () == 0)
    delete.setEnabled (false);
    update.setEnabled (false);
    else
    // Make sure that the first contact item in the names
    // list is highlighted.
    names.select (0);
    private void insert ()
    // Create an Insert data entry form to enter information
    // for a new contact.
    DataEntryForm def = new DataEntryForm (this, "Insert");
    // If the bOk Boolean flag is set, this indicates the user
    // exited the form by pressing the Ok button.
    if (def.bOk)
    // Create a Customer object and assign information from
    // the form to its fields.
    Customer temp = new Customer ();
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.address = new String (def.address.getText ());
    temp.round = new String (def.round.getText ());
    temp.phone = new String
              (def.phone.getText ());
    // Add a new customer item to the names component.
    names.add (temp.publication + ", " + temp.address);
    // Add the Customer object to the contacts Vector
    // object.
    customers.add (temp);
    // Make sure that the Delete and Update buttons are
    // enabled.
    delete.setEnabled (true);
    update.setEnabled (true);
    // Destroy the dialog box.
    def.dispose ();
    // Make sure that the first customer item in the names list
    // is highlighted.
    names.select (0);
    // ===========================================================
    // Load all customers from customers.dat into the customers
    // Vector object. Also, make sure that the last name/first
    // name from each contact is combined into a String object and
    // inserted into the names component - as a contact item.
    // ===========================================================
    private void loadCustomers ()
    FileInputStream fis = null;
    try
    fis = new FileInputStream ("customers.dat");
    DataInputStream dis = new DataInputStream (fis);
    int nCustomers = dis.readInt ();
    for (int i = 0; i < nCustomers; i++)
    Customer temp = new Customer ();
    temp.name = dis.readUTF ();
    temp.publication = dis.readUTF ();
    temp.address = dis.readUTF ();
    temp.round = dis.readUTF ();
    temp.phone = dis.readUTF ();
    names.add (temp.publication + ", " + temp.address);
    customers.add (temp);
    if (nCustomers > 0)
    delete.setEnabled (true);
    update.setEnabled (true);
    catch (IOException e)
    finally
    if (fis != null)
    try
    fis.close ();
    catch (IOException e) {}
    // Make sure that the first customer item in the names list
    // is highlighted.
    names.select (0);
    // ========================================================
    // Save all customer objects from the contacts Vector object
    // to customers.dat. The number of contacts are saved as an
    // int to make it easy for loadCustomers () to do its job.
    // ========================================================
    private void saveCustomers ()
    FileOutputStream fos = null;
    try
    fos = new FileOutputStream ("customers.dat");
    DataOutputStream dos = new DataOutputStream (fos);
    dos.writeInt (customers.size ());
    for (int i = 0; i < customers.size (); i++)
    Customer temp = (Customer) customers.elementAt (i);
    dos.writeUTF (temp.name);
    dos.writeUTF (temp.publication);
    dos.writeUTF (temp.address);
    dos.writeUTF (temp.round);
    dos.writeUTF (temp.phone);
    catch (IOException e)
    MsgBox mb = new MsgBox (this, "PP Error",
    e.toString ());
    mb.dispose ();
    finally
    if (fos != null)
    try
    fos.close ();
    catch (IOException e) {}
    private void update ()
    // Obtain index of selected customer item from the names
    // component.
    int index = names.getSelectedIndex ();
    // If no item was selected, index is -1. We cannot update
    // a customer if no customer item in the names component was
    // selected - because we would have nothing to work with.
    if (index != -1)
    // Obtain a reference to the Customer object (from the
    // customer Vector object) that is associated with the
    // index.
    Customer temp = (Customer) customers.elementAt (index);
    // Create and display an update entry form.
    DataEntryForm def = new DataEntryForm (this, "Update",
    temp.name,
    temp.publication,
    temp.address,
    temp.round,
    temp.phone);
    // If the user pressed Ok...
    if (def.bOk)
    // Update the customer information in the customers
    // Vector object.
    temp.name = new String (def.name.getText ());
    temp.publication = new String (def.publication.getText ());
    temp.address = new String (def.address.getText ());
    temp.round = new String (def.round.getText ());
    temp.phone = new String (def.phone.getText ());
    // Make sure the screen reflects the update.
    names.replaceItem (temp.publication + ", " + temp.address,
    index);
    // Destroy the dialog box.
    def.dispose ();
    // Make sure that the first customer item in the names
    // list is highlighted.
    names.select (0);
    // ========================================================
    // Class: Customer
    // This class describes the contents of a business customer.
    // ========================================================
    class Customer
    public String name;
    public String publication;
    public String address;
    public String round;
    public String phone;
    // ==========================================================
    // Class: DataEntryForm
    // This class provides a data entry form for entering customer
    // information.
    // ==========================================================
    class DataEntryForm extends JDialog implements ActionListener
    // bOk is a boolean flag. When true, it indicates that
    // the Ok button was pressed to terminate the dialog box
    // (as opposed to the Cancel button).
    public boolean bOk;
    // The following components hold the text that the user
    // entered into the visible text fields.
    public JTextField name;
    public JTextField publication;
    public JTextField address;
    public JTextField round;
    public JTextField phone;
    public void actionPerformed (ActionEvent e)
    // If the user pressed the Ok button, indicate this
    // by assigning true to bOk.
    if (e.getActionCommand ().equals ("Ok"))
    bOk = true;
    // Destroy the dialog box and return to the point
    // just after the creation of the DataEntryForm object.
    dispose ();
    public DataEntryForm (JFrame parent, String title)
    // Call the other constructor. The current constructor
    // is used for insert operations. The other constructor
    // is used for update operations.
    this (parent, title, "", "", "", "", "");
    public DataEntryForm (JFrame parent, String title,
    String name, String publication,
    String address, String round,
    String phone)
    // Initialize the superclass layer.
    super (parent, title, true);
    // Choose a grid bag layout so that components can be more
    // accurately positioned. (It looks nicer.)
    setLayout (new GridBagLayout ());
    // Add appropriate first name, last name, phone, fax, and
    // email components to the current DataEntryForm container.
    // (Remember, DataEntryForm is a subclass of Dialog.
    // Dialog is a container. Therefore, DataEntryForm
    // inherits the ability to be a container.)
    addComponent (this, new JLabel ("Name: "), 0, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.name = new JTextField (15);
    addComponent (this, this.name, 1, 0, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.name.setText (name);
    addComponent (this, new JLabel ("Publications: "), 0, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.publication = new JTextField (15);
    addComponent (this, this.publication, 1, 1, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.publication.setText (publication);
    addComponent (this, new JLabel ("Address "), 0, 2, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.address = new JTextField (15);
    addComponent (this, this.address, 1, 2, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.address.setText (address);
    addComponent (this, new JLabel ("Round No "), 0, 3, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.round = new JTextField (15);
    addComponent (this, this.round, 1, 3, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.round.setText (round);
    addComponent (this, new JLabel ("Phone Number "), 0, 4, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.WEST);
    this.phone = new JTextField (15);
    addComponent (this, this.phone, 1, 4, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    if (title.equals ("Update"))
    this.phone.setText (phone);
    addComponent (this, new JLabel (""), 0, 5, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    addComponent (this, new JLabel (""), 1, 5, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    JButton b;
    // Add an Ok button to this container.
    addComponent (this, b = new JButton ("Ok"), 0, 6, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    b.addActionListener (this);
    // Add a Cancel button to this container.
    addComponent (this, b = new JButton ("Cancel"), 1, 6, 1, 1,
    GridBagConstraints.NONE,
    GridBagConstraints.CENTER);
    b.addActionListener (this);
    // Set the size of the dialog window to 250 pixels
    // horizontally by 200 pixels vertically.
    setSize (250, 200);
    // Do not allow users to resize the dialog window.
    setResizable (false);
    // Make sure that the dialog window is visible.
    setVisible (true);
    private void addComponent (Container con, Component com,
    int gridx, int gridy,
    int gridw, int gridh, int fill,
    int anchor)
    // Get the current layout manager. It is assumed to
    // be a GridBagLayout object.
    LayoutManager lm = con.getLayout ();
    // Create a GridBagConstraints object to make it
    // possible to customize component positioning.
    GridBagConstraints gbc = new GridBagConstraints ();
    // Assign the x and y grid positions.
    gbc.gridx = gridx;
    gbc.gridy = gridy;
    // Assign the number of grid blocks horizontally and
    // vertically that are occupied by the component.
    gbc.gridwidth = gridw;
    gbc.gridheight = gridh;
    // Specify the component's resize policy (fill) and
    // the direction in which the component is positioned
    // when its size is smaller than available space (anchor).
    gbc.fill = fill;
    gbc.anchor = anchor;
    // Set the new constraints that the grid bag layout
    // manager will use.
    ((GridBagLayout) lm).setConstraints (com, gbc);
    // Add the component to the container.
    con.add (com);
    // ===========================================================
    // Class: MsgBox
    // This class displays a message box to the user. The message
    // is usually an error message. The user must press the Ok
    // button to terminate the message box.
    // ===========================================================
    class MsgBox extends JDialog implements ActionListener
    public void actionPerformed (ActionEvent e)
    // Terminate the dialog box in response to the user
    // pressing the Ok button.
    dispose ();
    public MsgBox (JFrame parent, String title, String msg)
    // Initialize the superclass layer.
    super (parent, title, true);
    // Store the msg argument in a Label object and add
    // this object to the center part of the dialog window.
    JLabel l = new JLabel (msg);
    add ("Center", l);
    // Create a Button object and add it to the south part
    // of the dialog window.
    JButton b = new JButton ("Ok");
    add ("South", b);
    // Make the current object a listener to events that
    // occur as a result of the user pressing the Ok
    // button.
    b.addActionListener (this);
    // Make sure that the Ok button has the focus.
    b.requestFocus ();
    // Do not allow users to resize the dialog window.
    setResizable (false);
    // Allow the layout manager to choose an appropriate
    // size for the dialog window.
    pack ();
    // Make sure that the dialog window is visible.
    setVisible (true);
    }

  • Database connection with EJB and  Sun Application Server

    I have tried some tutorials from sun in Savings account eg some errors were
    showing like primary key not found etc
    please help me to link EJB application with database application

    Debated: Primary Key requirement
    Does a GOOD database require a PK? Yes.
    Does EVERY database require a PK? Debated.
    Your db table needs a primary key. The PK is how a table identifies unique records.

  • How can i connect multiple forms using swings or applets(AWT) & with D-Base

    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,

    sreedharkommuru wrote:
    Hello Friends,
    I am Sreedhar from Hyderabad. working as a java developer in a small organization. I got a challenge to work on java stand alone (desktop) application. Basically our company is based on SCM(Supply Chain Management), I never work before using swings and AWT. now my present challenge is to develope an application on swings and AWT using Net Beans IDE. but i am unble find the code to connect one form to another form, i want to develop similar application like a web application , suppose if i click on OK button it has to connect next form. in the next for it has to take user name and password should allow me to access main form. please help me about this topic, if anybody interested i can send u the screen shots and i can post to ur mail. please help me as soon as possible,There is no magic, you need to spend a good amount of time in tutorials, here is a good one to start off with:
    [The Really Big Index|http://java.sun.com/docs/books/tutorial/reallybigindex.html]
    Here are a few tips:
    1 - Do not mix AWT and SWING: it'll just cause you headaches in the long run that you cannot fix without refactoring to properly not mix the 2 together.
    2 - You use JDBC to access the database
    3 - You make accessors/constructors to pass parameters that you need from one form to another.
    Have fun.

  • How 2 create a Jtext box and Jcombobox with database connectivity

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.sql.*;
    public class StockReport1 extends Frame implements ActionListener
    JLabel l1,l2,l3;
    JTextField t1,t2,t3;
    JPanel p1,p2;
    JButton b2,b4,b5;
    static Connection cn;
    static Statement st;
    static ResultSet rs;
    public StockReport1()
    l1=new JLabel("Name");
    l2=new JLabel("Age");
    l3=new JLabel("Native");
    t1=new JTextField(20);
    t2=new JTextField(20);
    t3=new JTextField(20);
    p1=new JPanel();
    p2=new JPanel();
    p1.add(l1);
    p1.add(t1);
    p1.add(l2);
    p1.add(t2);
    p1.add(l3);
    p1.add(t3);
    b2=new JButton("Exit");
    b4=new JButton("Next");
    b5=new JButton("Previous");
    b2.addActionListener(this);
    b4.addActionListener(this);
    b5.addActionListener(this);
    p2.add(b2);
    p2.add(b4);
    p2.add(b5);
    p1.setLayout(new GridLayout(3,1));
    p2.setLayout(new GridLayout(1,6));
    add(p1);
    add(p2);
    setSize(500,500);
    setVisible(true);
    setLayout(new FlowLayout(FlowLayout.LEFT,30,40));
    addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);}});
    public void actionPerformed(ActionEvent ae)
    try
    if(ae.getSource()==b2)
    System.exit(0);
    if(ae.getSource()==b4)
    if(rs.isLast()==false)
    rs.next();
    display();
    else
    rs.last();
    display();
    if(ae.getSource()==b5)
    if(rs.isFirst()==false)
    rs.previous();
    display();
    else
    rs.first();
    display();
    catch(SQLException se)
    se.printStackTrace();
    public static void main(String arg[])
    new StockReport1();
    public void display()
    try
    String s1=rs.getString(1);
    String s2=rs.getString(2);
    String s3=rs.getString(3);
    t1.setText(s1);
    t2.setText(s2);
    t3.setText(s3);
    catch(SQLException se)
    se.printStackTrace();
    }

    don't mix up with awt and swing, use JFrame instead of Frame.
    in display method just set the value of the result set to the textfields.
    or put all the data into arraylist after each next button click just read the value and put into textfields

  • AWT vs SWING and more

    1)Though the components used in awt and swing are similar what is the need for two seperate packages ?
    and
    2)what is the main usage of "getContentPane()" ?
    3)why do we use an appletviewer for executing applets provided the OS is Windows NT ..

    1)Though the components used in awt and swing are
    similar what is the need for two seperate packages ?AWT uses the native (heavyweight) components of the underlying Operating System. Actually a common (and small) subset of the provided components.
    In Swing the components a lightweight, there's no native component behind them, the components are painted by pure java code (sometimes sophisticated components). The swing applications thus can look and feel the same on all platforms.
    2)what is the main usage of "getContentPane()" ?When using swing you shouldn't add lightweight components to the window subclasses, only to the content pane.
    3)why do we use an appletviewer for executing applets
    provided the OS is Windows NT ..Did not understand.
    Kurta

  • Database connection to MS SQL 2005 (URGENT Help Needed)

    Hi all,
    Does anyone know how to connect my adobe form to MS SQL 2005?
    I have this code:
    try {
         InitialContext initialContext = new InitialContext ();
         DataSource dataSource = (DataSource) initialContext.lookup ("jdbc/MyAlias");
          java.sql.Connection connection = dataSource.getConnection ();
    } catch (SQLException e) {
         // handle exception
    } catch (NamingException e) {
    // handle exception
    Other than these, what else do i need to do inorder to get my database connection up?
    And after my database connection is up, how do i test to check if my database connection is up or not?
    How do i extract the information from the database and put them onto the textfields/dropdownlists on my form?
    Thanks In Advance

    Hi Mel,
    After implementing the codes and modifying them, some of them are underlined, why is this so? =X
    Or are u willing to exchange msn so i could send u the screenshot instead?
    Thanks In Advance
    (Sorry im not that good in this)
    (I shall underline the areas which represents the red underline in my web dynpro)
         //Code for database connection.
           InitialContext ctx = new InitialContext();
           DataSource ds = (DataSource)_ctx.lookup("jdbc/JXDataSource");_
           Connection conn = ds.getConnection();
           Statement st = null;
           ResultSet rs = null;
           IPrivateDetailed_Claims_FormView.IFillDataElement dataEle = null;
           st = conn.createStatement();
         //     Execute the appropriate SQL query
           rs = st.executeQuery("SELECT NAME WHERE VENDORCODE='9000116L' ");_     
           while (rs.next())       {
         //     Code that will populate your VN based on the data obtained in the ResultSet.
           dataEle = wdContext.createFillDataElement();
           dataEle.setName(_rs.getString(1)_);
          // dataEle.setAge(rs.getInt(2));
          // dataEle.setAddress(rs.getString(3));
           //wdContext.nodeFillData.addElement(dataEle);
           //  Close the connections
           rs.close();
           st.close();
                      conn.close();
    Edited by: JingXuan Lim on Jan 25, 2008 4:59 AM
    Edited by: JingXuan Lim on Jan 25, 2008 5:00 AM

  • Database connection getting stuked

    Hi,
    I am using oracle 9i R2 on Windows XP. I am in big trouble. Most of the time while getting connection to database, connection is stuked and finally become hung. I have checked service is alread started for Listener & Database. If I manually stop & start that both service, sometimes it is OK and able to get the connection. But sometime manually restart PC then get the connection.
    Please help me what can I do ....
    Thanks
    Niloy

    Hi,
    Right now I am trying to get connection but stuked. Alert log message is as follows :
    Fri Mar 18 12:29:47 2011
    starting up 1 shared server(s) ...
    starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
    Fri Mar 18 12:29:52 2011
    alter database mount exclusive
    Fri Mar 18 12:29:59 2011
    Successful mount of redo thread 1, with mount id 3059996737.
    Fri Mar 18 12:29:59 2011
    Database mounted in Exclusive Mode.
    Completed: alter database mount exclusive
    Fri Mar 18 12:30:00 2011
    alter database open
    Fri Mar 18 12:30:05 2011
    Beginning crash recovery of 1 threads
    Fri Mar 18 12:30:06 2011
    Started first pass scan
    Fri Mar 18 12:30:13 2011
    Completed first pass scan
    3512 redo blocks read, 67 data blocks need recovery
    Fri Mar 18 12:30:14 2011
    Started recovery at
    Thread 1: logseq 18, block 7203, scn 0.0
    Recovery of Online Redo Log: Thread 1 Group 2 Seq 18 Reading mem 0
    Mem# 0 errs 0: E:\ORACLE\ORADATA\SUPPORT\REDO02.LOG
    Fri Mar 18 12:30:18 2011
    Ended recovery at
    Thread 1: logseq 18, block 10715, scn 0.49318939
    67 data blocks read, 67 data blocks written, 3512 redo blocks read
    Crash recovery completed successfully
    Fri Mar 18 12:30:30 2011
    Thread 1 advanced to log sequence 19
    Thread 1 opened at log sequence 19
    Current log# 3 seq# 19 mem# 0: E:\ORACLE\ORADATA\SUPPORT\REDO03.LOG
    Successful open of redo thread 1.
    Fri Mar 18 12:30:32 2011
    SMON: enabling cache recovery
    Fri Mar 18 12:30:49 2011
    Undo Segment 1 Onlined
    Undo Segment 2 Onlined
    Undo Segment 3 Onlined
    Undo Segment 4 Onlined
    Undo Segment 5 Onlined
    Undo Segment 6 Onlined
    Undo Segment 7 Onlined
    Undo Segment 8 Onlined
    Undo Segment 9 Onlined
    Undo Segment 10 Onlined
    Successfully onlined Undo Tablespace 1.
    Fri Mar 18 12:30:49 2011
    SMON: enabling tx recovery
    Fri Mar 18 12:30:49 2011
    Database Characterset is WE8MSWIN1252
    Fri Mar 18 12:31:01 2011
    replication_dependency_tracking turned off (no async multimaster replication found)
    Completed: alter database open
    Please Check ...
    Thanks
    Niloy

  • Database connectivity toolkit -- create table

    Is it possible to implement the SQL command of AUTO_INCREMENT for the 1st column while creating table right at the start? ie making use of the "create table.vi" in the database connectivity toolkit?
    I know this can be done if i execute the SQL Command via the "execute query.vi". Just asking if there might be a better way. Thanks.
    Hope to achieve a similar output as shown below where the 1st column is set for auto-increment:
    No | Name| Age
    1   | John  | 25
    2   | David | 28
    3  | .....      | ....
    4.....
    5 .........

    Hey HWJ,
    I checked around and I think that the "execute query" method would be the best way to go about doing this.  I couldn't find a VI that had the AUTO_INCREMENT option and checked the Database Connectivity Toolset Manual and didn't find any reference to that command.  Please let me know if you have any further questions!
    Andy F.
    National Instruments

  • Date/Time erros when working with Database Connectivity toolkit

    Hi!,
    We are observing errors with date/time when working with LV. The error occurs when the system datetime format is set such that day precedes month (e.g. dd/mm/yyyy). Our VI uses LV 7.1, Database Connectivity 1.0 and SQL Server 2000 on a Win2000 machine.
    Problem details
    Our database in SQL server has a table having columns with data type "datetime"
    If the system date format (as set in control panel) is "mm/dd/yyyy", the 'insert into database' vi works fine. This function inserts the date and time (among other things) into the above mentioned table.
    However, when the system datetime is set to dd/mm/yyyy we start receiving error that date and time is beyond range for dates in which the date had the day field greater than 12 (e.g. 23/10/2005). With the same settings, if the date is such that day field is equal or less than 12 (e.g. 03/10/2005), we do not receive an error but the date is interpreted as 10 March 2005 rather than 03 September 2005.
    Clearly LV (or is it SQL) is mistaking the day field as month.
    We have taken care that when sending and receiving date, the format date and time string is set as per system settings.
    Thus, if system setting is "dd/mm/yyyy" our format string is "%d/%m/%Y"
    And if the setting is "mm/dd/yyyy" our format string is"%m/%d/%Y"
    Any help on problem cause and cure is welcome.
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

    Hi Xu,
    You answer led me to some very interesting fact finding on how SQL server handles date and time. I have attached a zip file which contains webpages that throw more light on this issue.
    The attached pages tell me that SQL has an inbuilt date/time reference format. The default in mm/dd/yyyy. Which explains why my VI worked when I used that format to write to SQL.
    However there is a catch:
    SQL expects the date/time to be in its inbuilt reference format when you WRITE data to SQL. If the date/time is in a different format, better tell SQL about it by using say the SET command you mentioned.
    BUT what about the date/time format when you are reading data from SQL?
    Our finding is that SQL sends date/time string in the system date format when you READ from SQL !!! That is very surprising behaviour (why differentiate between write and read?).
    Is our finding correct?
    So, we adopted the following simple strategy (yet to be fully tested):
    1) Whenever we write date/time to SQL, the string is formatted as mm/dd/yyyy. Presently, the user's SQL server is in the default state. Caveat is that if the user changes SQL date/time from default (which is mm/dd/yyyy) to anything else, our software will give errors. But then he changed it  ;-)
    2) When we read date/time from SQL we format the string as per system date/time format.
    I know this is not very robust coding. But assuming the user keeps his SQL in the current setting, should we expect smooth working?
    In other words, are there any errors and/or flaws in our strategy?
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

  • Database connectivity toolset

    Hi,
    I am using the VI "DB Tools Select Data" from the database connectivity toolset. And I have a problem with the VI "DB Tools Execute Query" that is included. I would like to select a specific column from a specific table in my database and it is ok so long the name of the table is just one work, example "Names", but if the name of the table consists of two words ("Last Name") I get error, the message says that it can't find the table Last, i.e. not the whole string is read, just the first part. How can I manage to get the "Conn Execute.vi" to read the whole SQL query? Any suggestions?
    Attachments:
    Copy_DB Tools Select Data.vi ‏32 KB

    As far as I know and what I experienced, there are no blanks allowed (and some other special characters), both in table names and column names.
    Just replace the blanks with an underscore and it should work.
    Using LV8.0
    Don't be afraid to rate a good answer...

Maybe you are looking for

  • How to provide F4 help for a field in table control

    Hi Friends, I have requirement like below. 1.Create one custom transaction code with header and item information. 2.In item level, we will be designed table control to enter/display the data. 3.Table control’s first field will be material number and

  • I can't drag and drop my songs from mp3 rocket to my iphone?

    i have my mp3 rocket account linked to my itunes account and some songs get put onto my phone, but some dont. i can't drag and drop and if i try to rename it with correct characters, nothing happens. the mp3 rocket folder is in music under shared lib

  • Issues regarding Abap Query

    We have created a query " AQYZSYSTQV000001WBSLIST======= " and then query program was copied to ZFI_WBSLIST On execution of  ZFI_WBSLIST,got the below error. A RAISE statement in the program "SAPLAQGF" raised the exception condition "NO_QUERY_REPORT"

  • Application Failed codesign verification

    hi people! I'm stuck on a finel step: uploading the app via Application loader. Yes , I have already searched this forum and it seams that all my certificates are right. any ideas? please, I'm running out of time.

  • 10.5.4 and Photoshop/InDesign Problems

    After the previous problems that presented in the upgrade to 10.5.3 our company decided to test the upgrade to 10.5.4 before upgrading. We have experienced a strange thing happening to files located on the server. If you are in InDesign and you have