Why the tree show different while i use XML and XMLList as the data provider

Code is as follows:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:services="services.*" layout="vertical">
<services:CommonSvc id="ws" NameSpace="ws.wsSysDict" creationComplete="ws.getXmlList()"/>
<mx:Tree width="100%" height="100%" labelField="@Name" dataProvider="{ws.xml}" fontSize="18" showRoot="false"/>
</mx:Application>
Shown below:
as you see above,the font show Incomplete, if i change the dataprovider as  follows:
<mx:Tree width="100%" height="100%" labelField="@Name" dataProvider="{ws.xml.obj}" fontSize="18" showRoot="false" />
it  show complete when i use xmllist as the tree's dataprovider
why it show like that while i use the xml as the tree's dataprovider,hope anybody's helping

XML is a single node, XMLList is multiple nodes.  ShowRoot will affect the
display

Similar Messages

  • How to change the data provider of the tree with the selection of combobox

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

  • Best Practice on using and refreshing the Data Provider

    I have a �users� page, that lists all the users in a table - lets call it master page. One can click on the first column to of the master page and it takes them to the �detail� page, where one can view and update the user detail.
    Master and detail use two different data providers based on two different CachedRowSets.
    Master CachedRowSet (Session scope): SELECT * FROM UsersDetail CachedRowSet (Session scope): SELECT * FROM Users WHERE User_ID=?I want the master to be updated whenever the detail page is updated. There are various options to choose from:
    1. I could call masterDataProvider.refresh() after I call the detailDataProvider.commitChanges() - which is called on the save button on the detail page. The problem with this approach is that the master page will not be refreshed across all user sessions, but only for the one saving the detail page.
    2. I could call masterDataProvider.refresh() on the preRender() event of the master page. The problem with this approach is that the refresh() will be called every single time someone views the master page. Further more, if someone goes to next page (using the built in pagination on the table on master page) and clicks on a user to view its detail and then close the detail page, it does not keep track of the pagination (what page the user was when he/she clicked on a record to view its detail).
    I can find some work around to resolve this problem, but I think this should be a fairly common usage (two page CRUD with master-detail). If we can discuss and document some best practices of doing this, it will help all the developers.
    Discussion:
    1.     What is the best practice on setting the scope of the Data Providers and CahcedRowSet. I noticed that in the tutorial examples, they used page/request scope for Data Provider but session scope for the associated CachedRowSet.
    2.     What is the best practice to refresh the master data provider when a record/row is updated in the detail page?
    3.     How to keep track of pagination, (what page the user was when he/she clicked on the first column in the master page table), so that upon updating the detail page, we cab provide user with a �Close� button, to take them back to whaterver page number he/she was.
    Thanks
    Message was edited by:
    Sabir

    Thanks. I think this is a useful information for all. Do we even need two data providers and associated row sets? Can't we just use TableRowDataProvider, like this:
    TableRowDataProvider rowData=(TableRowDataProvider)getBean("currentRow");If so, I am trying to figure out how to pass this from master to detail page. Essentially the detail page uses a a row from master data provider. Then I need user to be able to change the detail (row) and save changes (in table). This is a fairly common issue in most data driven web apps. I need to design it right, vs just coding.
    Message was edited by:
    Sabir

  • How to edit bitmap which is imported in flash using xml and save the edited bitmap back to xml in flash.

    hi all
    It would be appreciated if any one let me know how to edit
    bitmap which is imported in flash using xml and save the edited
    bitmap back to xml in flash.
    Is it posible to save the bitmap data in flash?
    thanks in advance

    Yes you can... but like I said before you need to upload the
    data from the changes you make to a server.
    In terms of the solution... its unlikely that you'll find one
    specifically for your needs. You will have to learn whatever you
    don't know how already and maybe adapt some existing examples to
    your needs.
    To change the visual state of a movie clip... you just do all
    the regular things that you want to do to it using flash... scale,
    rotation, drawing API , textfields etc in actionscript. If you
    don't know how to how to do that stuff, then you need to learn that
    first. That's basic actionscript.
    You can capture the visual state of a movieclip using the
    BitmapData class. That includes a loaded jpeg. You can also
    manipulate bimatp data using the same class. You should read up on
    that if you don't know how to use it or check out the examples
    below for uploading info.
    For uploading to the server:
    Here's an as2 solution that took 15 secs to find using
    google:
    http://www.quasimondo.com/archives/000645.php
    If you're using as3, google search for "jpeg encoder as3" and
    look through that info. There are also historical answers in the
    forums here related to this type of thing that might help as
    well.

  • How to read data from the data provider using javascript

    Hi,
    Please let me know how to read the data from the dataprovider using javascript(query assigned to the data provider).
    My query has filter charateristics, free charateristics, charateristics in rows and key figure in column.
    Thanks a lot for your kind help
    Regards
    Kandasamy

    Kandaswamy,
    Assign an ID to your table item , then in JavaScript , you can use ID.innerHTML and you will get the HTML code within that table for the same , then you can find out how best to get the exact value you desire from the innerHTML value which is a string with the entire HTML from within the table item.
    Arun
    Hope it helps....

  • Use condition for assigning query to data provider with Javascript

    Hi gurus,
    I want to assign a query dynamically to a data provider when the user activated a Tab Panel in a Web Template (BI7).
    I can do that easily with the standard function SET_DATA_PROVIDER_PARAMETERS but this action is do each time of the activation of the Tab Panel.
    So I try to make a javascript for assign the query to the data provider only one time.
    My problem is I havenu2019t found a solution to get the default query assigning to the data provider.
    Itu2019s an example of what I try to do with javascipt :
    function Load_Query()
    var r=GET_DATA_PROVIDER PARAMETER ("QUERYVIEW_DATA_PROVIDER")
    if (r <>empty)
        executeJS_SET_DATA_PROVIDER_PARAMETERS_R()
    Thank you for help,
    Franck

    Hi Janice,
    You can check the Option Display Variable values only once.
    Thie you will the variables being displayed only once eventhough they are used in Multiple Data provider.
    If you want som variable to be data provider specific, then , you can create a new variable and add it int eh query.
    For example in your case let us say COMP1 is the variable for company code used in DP1 and DP2.
    If you want a different values to be selected for company code in DP1 and DP2 just replce the variable in DP2 with a new variabel COMP2.
    Hope this helps.
    Regards.
    Shafi.

  • Using a Web Service as a data provider for a Crystal Report

    <p>I&#39;m trying to write a Crystal Reports XI report that uses a Web Service as the data provider.  I have a Web Service written in ColdFusion that looks like this.<br /><br /><cfcomponent displayName="FindEmployee" ><br />   <cffunction name="FindEmployeeSort" access="remote"          <br />               returnType="xml" output="false"><br />      <cfdump var=form><br />      <cfset myXML = ""><br />       <!--- FindEmployeeSort body ---><br />       <cfquery name="EmployeeQuery" datasource="Production"><br />           Select * from employee<br />          <cfif isdefined(&#39;form.lastname&#39;)><br />             WHERE lastname LIKE &#39;%#form.lastname#%&#39; <br />          </cfif><br />           Order by lastname asc <br />        </cfquery><br />     <cfreturn EmployeeQuery>  <br />   </cffunction><br /></cfcomponent><br /><br />I can get the web service to work from a ColdFusion page (either locally or on a remote server).</p><p>When I try to create the CR data source, I get the following error:</p><p>Crystal Reports<br />! Logon Failed.<br />Details: Cannot find correspondign table information in the XML file</p><p>The steps I took were:<br />* Choose XML from the "Avalable Data Sources"<br />* Choose "Use Web Service Data Source"<br />* Choose "Use HTTP(S) WSDL" with a url of <a href="http://host/directory/FindEmployee.cfc?wsdl">http://host/directory/FindEmployee.cfc?wsdl</a><br />* Leave the "HTTP(S) Web Service User ID:" and "HTTP(S) Web Service Password:" parameters blank<br />* Accept the defaults for Services, Ports, and Methods.  They are respectively FindEmployee, FindEmployee.cfc and FindEmployeeSort.<br />* Then get the error</p><p>The most likely candidate to me is the user id and password, but I have no idea what to use.  I didn&#39;t have to set any login information up in the ColdFusion pages that I used to test the Web Service.</p><p>Any ideas where to go from here?</p><p>Thanks,</p><p>Brian</p>

    Please re-post if this is still an issue to the Java Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • How to create a user using XML and specifying addional attributes that are objects

    I'm trying to create a user using XML and specifying some attributes that are objects and not sure how to do it. How would I set the DirectoryUserAcl to Public?
    Here's the xml file:
    <?xml version = '1.0' standalone = 'yes'?>
    <SimpleUser>
    <UserName>mike2</UserName>
    <Password>abc123</Password>
    <AdminEnabled>false</AdminEnabled>
    <HomeFolderRoot>/home</HomeFolderRoot>
    <HasContentQuota>false</HasContentQuota>
    <DirectoryUserAcl> ??? </DirectoryUserAcl>
    <DefaultAclBundleAcl> ??? </DefaultAclBundleAcl>
    <HomeFolderPolicyBundleAcl> ??? </HomeFolderPolicyBundleAcl>
    </SimpleUser>

    I figured out the answer:
    <?xml version = '1.0' standalone = 'yes'?>
    <SimpleUser>
    <UserName>mike2</UserName>
    <Password>abc123</Password>
    <AdminEnabled>false</AdminEnabled>
    <HomeFolderRoot>/home</HomeFolderRoot>
    <HasContentQuota>false</HasContentQuota>
    <DirectoryUserAcl classname="SystemAccessControlList" refType="name">Public</DirectoryUserAcl>
    </SimpleUser>
    null

  • Using ConnBean and CursorBean with a Data Source

    Hi all,
    I',m making a web app. using the Jdev (RUP4) with OA Extension. I looked in the help menu under "About Data-Access JavaBeans and Tags". Here I found the following example, but for some stange reason I cannot get the setProperty to work.
    Example: Using ConnBean and CursorBean with a Data Source This following is a sample JSP page that uses ConnBean with a data source to open a connection, then uses CursorBean to execute a query.
    <%@ page import="java.sql.*, oracle.jsp.dbutil.*" %>
    <jsp:useBean id="cbean" class="oracle.jsp.dbutil.ConnBean" scope="session">
    <jsp:setProperty name="cbean" property="dataSource"
    value="<%=request.getParameter("datasource")%>"/>
    </jsp:useBean>
    <% try {
    cbean.connect();
    String sql="SELECT ename, sal FROM scott.emp ORDER BY ename";
    CursorBean cb = cbean.getCursorBean (CursorBean.PREP_STMT, sql);
    out.println(cb.getResultAsHTMLTable());
    cb.close();
    cbean.close();
    } catch (SQLException e) {
    out.println("<P>" + "There was an error doing the query:");
    out.println("<PRE>" + e + "</PRE>\n<P>"); }
    %>
    Does anyone know how to set the "Property" to a datasource and make it work?
    Best regards,
    MHCI

    There is no point-and-click (Import Data Source Metadata) way to use an LDAP server as a datasource. You have to use the Java Function provided on dev2dev. If you need help with it, please post here.
    - Mike

  • Database updation using XML and stored Procedure?

    Hello,
    I want to perform updation in multiple tables using XML files.Please suggest can I do updation using xml and stored procedure.
    If yes then which is more efficient and takes less time.
    1.Updation using xml files only
    2.Updation using xml files with stored procedure.
    3.Stored procedure alone.
    If direct xml and stored procedure communication is possible.then please write how.
    Thanks in advance for any help.

    Here's a sample. The next code drop of the XSQL Servlet will make the easy-to-do from within XSQL Pages:
    package package1;
    import org.w3c.dom.*;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import oracle.xml.sql.query.OracleXMLQuery;
    public class Class1 extends Object {
    public static void main( String[] arg ) throws Exception {
    Connection conn = getConnection();
    CallableStatement ocs = conn.prepareCall("begin ? := App.HotItems('PAUL'); end;");
    ocs.registerOutParameter(1,OracleTypes.CURSOR);
    ocs.execute();
    ResultSet rs = ((OracleCallableStatement)ocs).getCursor(1);
    OracleXMLQuery oxq = new OracleXMLQuery(conn,rs);
    System.out.println(oxq.getXMLString());
    oxq.close();
    rs.close();
    ocs.close();
    conn.close();
    public static Connection getConnection() throws Exception {
    String username = "scott";
    String password = "tiger";
    String dburl = "jdbc:oracle:thin:@localhost:1521:xml";
    String driverClass = "oracle.jdbc.driver.OracleDriver";
    Driver d = (Driver)Class.forName(driverClass).newInstance();
    return DriverManager.getConnection(dburl,username,password);
    null

  • I can't believe I have to ask this...   I've minimized the "Data Provider" screen....

    Post Author: black
    CA Forum: General Feedback
    What an embarassing first post... I'm new to BusinessObjects (6.5.1) and half way through building a query I've minimized the "Data Provider" screen....  and can't restore it (can't even find it)...  it's obviously active (offscreen I guess) because everything else is now greyed out and is inactive....
    Tell me:    a)  I'm not the first person to do this...
            and b) How to get it back
    I'm unable to do anything until I have a solution to this since BO appears to save the position - if I close and re-open, or open a new query, I find myself in the same situation.
    I look forward (really) toyour suggestions!
    Thanks

    Post Author: jsanzone
    CA Forum: General Feedback
    Black,
    You're not the first person to do this, however, I've never had this problem before, only got some crib notes on the subject so this may or may not work:
    1. in regedit clear the key and all subfolders: HKEY_CURRENT_USER\Software\Business Objects\Suite 11.5\default\BusinessObjects\Application Preferences\BusinessReporter\Desktop Intelligence 2. Restart DeskI and all menus will be reset to original.

  • Why does lun show different size on different rac nodes?

    Hi all,
    We are trying to increase ASM disk space and with respect to it when we are trying to allocate more space this question came across my mind. Now this was previously configured by my previous SA.
    [root@oracledbtest1 ~]# /etc/init.d/oracleasm querydisk -d `/etc/init.d/oracl
    cut -f2,10,11 -d" " | perl -pe 's/"(.*)".*\[(.*), *(.*)\]/$1 $2 $3/g;' |
    while read v_asmdisk v_minor v_major
    do
    v_device=`ls -la /dev | grep " $v_minor, *$v_major " | awk '{print $10}'`
    echo "ASM disk $v_asmdisk based on /dev/$v_device [$v_minor, $v_major]"
    done
    **ASM disk ASM01 based on /dev/dm-15 [253, 15]**
    **ASM disk ASM02 based on /dev/dm-14 [253, 14]**
    node 2:
    [root@oracledbtest1 ~]# /etc/init.d/oracleasm querydisk -d `/etc/init.d/oracleasm listdisks -d` |
    cut -f2,10,11 -d" " | perl -pe 's/"(.*)".*\[(.*), *(.*)\]/$1 $2 $3/g;' |
    while read v_asmdisk v_minor v_major
    do
    v_device=`ls -la /dev | grep " $v_minor, *$v_major " | awk '{print $10}'`
    echo "ASM disk $v_asmdisk based on /dev/$v_device [$v_minor, $v_major]"
    done
    **ASM disk ASM01 based on /dev/dm-13 [253, 13]**
    **ASM disk ASM02 based on /dev/dm-14 [253, 14]**
    Now, can any one help me in telling why are my LUN's showing different sizes on RAC and also the best way to allocate the space to the disks in the above scenario.
    P.S I am fairly new in posting to the OTN. Please excuse if I am not clear with my question.
    Edited by: 902932 on Apr 8, 2013 8:25 AM

    why you think the space is different between the 2 nodes?
    The devices are different, that's ok, dm- is the device mapper name, and several devices will create dm-* like entries, so it's ok to have them different.
    When you add a disk, you should follow an approach like:
    Present the disk on the storage
    Refresh the luns on all the nodes
    Create the oracleasm disk on one node
    refresh the oracleasm disks on all the nodes
    verify the new oracleasm disk is present on all nodes in /dev/oracleasm/disks/*
    At this point, you can use asmca or sqlplus in the +ASMn instance to make your asm diskgroup to grow, or create a new disk group                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Why the date on my iPad is showing 1st Jan 2555be? I can't change it back to 2012!

    I'm not sure when it started, but now the date on my iPad is showing 1st Jan 2555be and I can't change it back to the current date. Anyone can help or share if you faced the same problem? Or is it because of some apps that I installed that caused the problem.

    Settings-general-international.
    Change calender format, you have it set to Buddhist.

  • Why parition table is different between S10 3/05 and S10 6/06?

    I want to set up RAID 1 (mirroring) using the Solaris Volume Manager (SVM) on my Solaris 10 6/06 x86 machine. I have 2 identical Seagate 40GB HDD's (model ST340016A).
    The partition table on the primary disk was already defined by Solaris 10 3/05 OS before I reinstalled the OS (Solaris 10 6/06). The partition table of the primary disk is as follows:
    leopard $ prtvtoc /dev/rdsk/c0d0s2
    * /dev/rdsk/c0d0s2 partition map
    * Dimensions:
    * 512 bytes/sector
    * 63 sectors/track
    * 32 tracks/cylinder
    * 2016 sectors/cylinder
    * 38771 cylinders
    * 38769 accessible cylinders
    * Flags:
    * 1: unmountable
    * 10: read-only
    * Unallocated space:
    * First Sector Last
    * Sector Count Sector
    * 20984544 57173760 78158303
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
    0 2 00 6048 8390592 8396639 /
    1 3 01 8396640 2098656 10495295
    2 5 00 0 78158304 78158303
    3 7 00 10495296 2098656 12593951 /var
    4 0 00 12593952 4195296 16789247 /opt
    5 8 00 16789248 4195296 20984543 /home
    8 1 01 0 2016 2015
    9 9 01 2016 4032 6047
    It has 38771 cyclinders.
    Now I want to create exactly the same partition table on the secondary disk, but it refuses to match the same partition table to the primary disk. It stills gives 40GB, but the number of cycliners is not the same. Below is the partition table of the secondary disk.
    leopard $ prtvtoc /dev/rdsk/c0d1s2
    * /dev/rdsk/c0d1s2 partition map
    * Dimensions:
    * 512 bytes/sector
    * 63 sectors/track
    * 255 tracks/cylinder
    * 16065 sectors/cylinder
    * 4864 cylinders
    * 4862 accessible cylinders
    * Flags:
    * 1: unmountable
    * 10: read-only
    * Unallocated space:
    * First Sector Last
    * Sector Count Sector
    * 48195 78059835 78108029
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
    2 5 01 0 78108030 78108029
    8 1 01 0 16065 16064
    9 9 00 16065 32130 48194
    leopard $
    It has 4864 cyclinders not 38771. Why?
    You can see the disk dimension is different between these 2 disks. I tried to redefine it to match the primary disk, but it keeps coming back to the different table.
    Do you know why the partition table defined by Solaris 10 6/06 differs to what Solaris 10 3/05 had defined? How do I force the parition table to match with the primary disk? Both disks must match so that SVM would work.
    Can anyone shed any light as to why it happens? Thank you for your help.
    Trevor

    I want to set up RAID 1 (mirroring) using the Solaris Volume Manager (SVM) on my Solaris 10 6/06 x86 machine. I have 2 identical Seagate 40GB HDD's (model ST340016A).
    The partition table on the primary disk was already defined by Solaris 10 3/05 OS before I reinstalled the OS (Solaris 10 6/06). The partition table of the primary disk is as follows:
    leopard $ prtvtoc /dev/rdsk/c0d0s2
    * /dev/rdsk/c0d0s2 partition map
    * Dimensions:
    * 512 bytes/sector
    * 63 sectors/track
    * 32 tracks/cylinder
    * 2016 sectors/cylinder
    * 38771 cylinders
    * 38769 accessible cylinders
    * Flags:
    * 1: unmountable
    * 10: read-only
    * Unallocated space:
    * First Sector Last
    * Sector Count Sector
    * 20984544 57173760 78158303
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
    0 2 00 6048 8390592 8396639 /
    1 3 01 8396640 2098656 10495295
    2 5 00 0 78158304 78158303
    3 7 00 10495296 2098656 12593951 /var
    4 0 00 12593952 4195296 16789247 /opt
    5 8 00 16789248 4195296 20984543 /home
    8 1 01 0 2016 2015
    9 9 01 2016 4032 6047
    It has 38771 cyclinders.
    Now I want to create exactly the same partition table on the secondary disk, but it refuses to match the same partition table to the primary disk. It stills gives 40GB, but the number of cycliners is not the same. Below is the partition table of the secondary disk.
    leopard $ prtvtoc /dev/rdsk/c0d1s2
    * /dev/rdsk/c0d1s2 partition map
    * Dimensions:
    * 512 bytes/sector
    * 63 sectors/track
    * 255 tracks/cylinder
    * 16065 sectors/cylinder
    * 4864 cylinders
    * 4862 accessible cylinders
    * Flags:
    * 1: unmountable
    * 10: read-only
    * Unallocated space:
    * First Sector Last
    * Sector Count Sector
    * 48195 78059835 78108029
    * First Sector Last
    * Partition Tag Flags Sector Count Sector Mount Directory
    2 5 01 0 78108030 78108029
    8 1 01 0 16065 16064
    9 9 00 16065 32130 48194
    leopard $
    It has 4864 cyclinders not 38771. Why?
    You can see the disk dimension is different between these 2 disks. I tried to redefine it to match the primary disk, but it keeps coming back to the different table.
    Do you know why the partition table defined by Solaris 10 6/06 differs to what Solaris 10 3/05 had defined? How do I force the parition table to match with the primary disk? Both disks must match so that SVM would work.
    Can anyone shed any light as to why it happens? Thank you for your help.
    Trevor

  • Why the data inserted two times into the DB?

    Hai all,
    When I press the submit button in my form the data will be inserted two timesinto DB. Please help me.
    import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import com.vguss.bean.RegisterInfoBean; import com.vguss.helper.Out; public class InsertRegInfo { public static Connection connection = DBConnection.getDBConnection(); public static void insertRegData(RegisterInfoBean bean) { Connection connection = DBConnection.getDBConnection(); String loginID = bean.getLoginId(); try { PreparedStatement pst = connection .prepareStatement("SELECT login_id FROM login_details WHERE login_id = ?"); pst.setString(1, loginID); ResultSet set = pst.executeQuery(); if (!set.next()) { insertData(bean); } } catch (SQLException e1) { e1.printStackTrace(); } } private static void insertData(RegisterInfoBean bean) { try { PreparedStatement ps = connection .prepareStatement("INSERT INTO login_details (login_id, password, profile_created_by, security_question, answer, full_name, receive_sms, show_details, agree_terms, register_on) VALUES (?,?,?,?,?,?,?,?,?,now())"); ps.setString(1, bean.getLoginId()); ps.setString(2, bean.getPassword()); ps.setString(3, bean.getProf_created_by()); ps.setString(4, bean.getSecurity_Question()); ps.setString(5, bean.getAnswer()); ps.setString(6, bean.getFullName()); ps.setString(7, bean.getLikeSMS()); ps.setString(8, bean.getShowDetails()); ps.setString(9, bean.getAgreeToTerms()); ps.executeUpdate(); PreparedStatement pstmt = connection .prepareStatement("INSERT INTO user_profile (login_id, gender, email, date_of_birth) VALUES (?, ?, ?, ?)"); pstmt.setString(1, bean.getLoginId()); pstmt.setString(2, bean.getGender()); pstmt.setString(3, bean.getEmailID()); pstmt.setString(4, bean.getDateOfBirth()); pstmt.executeUpdate(); /* insert login id to preferred_partner table */ PreparedStatement pStmt = connection .prepareStatement("INSERT INTO preferred_partner (login_id) VALUES(?)"); pStmt.setString(1, bean.getLoginId()); pStmt.executeUpdate(); } catch (SQLException e) { Out.err(e); } } }

    The most obvious thought is that you have a duplicate login id.
    You're trying, but I would not consider this to be well written code, for these reasons:
    1. You don't close any JDBC resources in finally blocks - no connections, no statements, no result sets. Search the forum for people with "max open cursors exceeded" to see why this is a bad idea.
    2. You create a static Connection in this class, but nobody closes it. Classes that execute SQL should not be responsible for obtaining connections; a Connection should be provided to them. Transactions are the reason: a class executing SQL can't know if it's involved in a unit of work with other classes. Somebody who knows the use case and the transaction boundaries ought to be getting the Connection, handling commit/rollback, and closing the Connection.
    3. Refactor that INSERT into three methods. You'll be glad you did someday.
    4. Your INSERT method looks like it's doing a security check, too. Isn't it a little late for that? If you must, move that code into a separate method that returns a boolean. A well-designed method does one thing well. Yours is doing two.
    5. The common JDBC idiom isn't "if (!set.next())", it's "while (set.next())". It's good to use common idioms, because it makes it easier for other people to understand your code.
    But see if you have a repeated login ID.
    And step through in a debugger to see what's going on.
    %

Maybe you are looking for