Using string password

Hi
Can someone give me a sample code about how to use string password when encrypting and decrypting data?
I have made an application that encrypts and decrypts data and it can even save password. Password is not created from string see code:
KeyGenerator kgen = KeyGenerator.getInstance("Blowfish");
SecretKey skey = kgen.generateKey();
byte[] raw = skey.getEncoded();
SecretKeySpec skeySpec = new SecretKeySpec(raw, "Blowfish");
Now I want that client can give a password and application use that while encrypting and decrypting.
I'm using CipherOutputStream and CipherInputStream to save and open data. I'm using Blowfish algorithm.
Regards
Juha

Hi Juha,
Here is the sample code for encrypting and decrypting a string.
import java.io.*;
import java.security.*;
import javax.crypto.*;
import sun.misc.*;
public class SecretWriting{
public static void main(String args[]) throws Exception{
if(args.length<2)
System.out.println("Usage : SecretWriting -e|-d text");
return;
Security.addProvider(new com.sun.crypto.provider.SunJCE());
Key key;
try{
ObjectInputStream in=new ObjectInputStream(new FileInputStream("des.key"));
key=(Key)in.readObject();
in.close();
catch(FileNotFoundException fnfe)
KeyGenerator generator= KeyGenerator.getInstance("DES");
generator.init(new SecureRandom() );
key=generator.generateKey();
ObjectOutputStream out=new ObjectOutputStream(new FileOutputStream("des.key"));
out.writeObject(key);
out.close();
Cipher cipher=Cipher.getInstance("DES/ECB/PKCS5Padding");
if(args[0].indexOf("e") !=-1)
cipher.init(Cipher.ENCRYPT_MODE,key);
String amalgam=args[1];
for(int i=2;i<args.length;i++)
amalgam+=" "+args;
byte[] stringBytes=amalgam.getBytes("UTF8");
byte[] raw=cipher.doFinal(stringBytes);
BASE64Encoder encoder = new BASE64Encoder();
String base64 = encoder.encode(raw);
System.out.println(base64);
else if(args[0].indexOf("d")!=-1)
cipher.init(Cipher.DECRYPT_MODE,key);
BASE64Decoder decoder = new BASE64Decoder();
byte[] raw = decoder.decodeBuffer(args[1]);
byte[] stringBytes = cipher.doFinal(raw);
String result = new String(stringBytes,"UTF8");
System.out.println(result);
I hope this will help you out.
Thanks
Bakrudeen
Technical Support Engineer
Sun MicroSystems Inc, India

Similar Messages

  • Use a password as a key

    hi,
    I am working with some code which encrypts data being sent to streams. I currently initialise the instance in the following way.
    SecretKey key = KeyGenerator.getInstance("DES").generateKey();
    STStreamEncryptor encrypter = new STStreamEncryptor(key);
    Here's the constructor for the STStreamEncryptor class......
    public STStreamEncryptor(SecretKey key) {
    // Create an 8-byte initialization vector
    byte[] iv = new byte[]{
    (byte)0x8E, 0x12, 0x39, (byte)0x9C,
    0x07, 0x72, 0x6F, 0x5A
    AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
    try {
    ecipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
    dcipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
    // CBC requires an initialization vector
    ecipher.init(Cipher.ENCRYPT_MODE, key, paramSpec);
    dcipher.init(Cipher.DECRYPT_MODE, key, paramSpec);
    } catch (java.security.InvalidAlgorithmParameterException e) {
    } catch (javax.crypto.NoSuchPaddingException e) {
    } catch (java.security.NoSuchAlgorithmException e) {
    } catch (java.security.InvalidKeyException e) {
    What I want to do is to be able to use a password or phrase as the encryption key instead of generating the key. Can anyone help??
    Thanks
    Steve

    hi,
    I've used this class but it throws a number of exceptions. For example when I run the first encryption and decryption on a string it works fine. But when I try to encrypt and decrypt the next string I get an exception, IllegalBlockSizeException: Input length (with padding) not multiple of 8 bytes. Any ideas what the problem is??
    Thanks
    Steve

  • GetConnection(String URL) vs. (String URL, String user, String password)

    Hi,
    would have a question referring to the documention at http://docs.oracle.com/cd/E11882_01/appdev.112/e13995/oracle/jdbc/OracleDriver.html where the forms of getConnection are described.
    I would like to convert from using a signature that takes the URL, user name, and password as separate parameters to using a signature that takes the URL, user name, and password all as part of a URL parameter.
    While I was able to successfully connect to my database using the form getConnection(String URL, String, user, String password); I am not able to achieve the same when using getConnection(String URL).
    Here are the code snippets, maybe someone can point out the reason why the second approach is not working?
    approach 1 - working fine
    String driver = "oracle.jdbc.driver.OracleDriver";
    try {
              Class.forName(driver);
              } catch(java.lang.ClassNotFoundException e) {
              String connectionURL = "jdbc:oracle:thin:@localhost:1521:PMT";
              String pgUser = "\"James.Smith@000\"";
              String pgPwd = "\"js\"";
         try {
                   Connection conn = DriverManager.getConnection(connectionURL, pgUser, pgPwd);
    approach 2 - error: java.sql.SQLException: The Network Adapter could not establish the connection
    String driver = "oracle.jdbc.driver.OracleDriver";
    try {
              Class.forName(driver);
              } catch(java.lang.ClassNotFoundException e) {
    String connectionURL = "jdbc:oracle:thin:\"James.Smith@000\"/\"js\"@localhost:1521:PMT";
         try {
                   Connection conn = DriverManager.getConnection(connectionURL);
    Thanks a lot in advance
    Kind regards
    Thomas

    Let me get this clear.
    You want a login dialog.
    Some program calls the dialog and waits untile user respond
    once the user press ok or cancel it reutrn the users input to the caller.
    You can do this directly using JFrame
    but you can do it wil JDialog if you use it as aModal dialog.
    it will look like this
    class LogInDialog  extends JDialog implements ActionListener{
       String value;
       public LogInDialog(){
          setModel(true);
        // This is what you invoke
        public String loadDialog(){
            setVisible(true);
            return value;
        public void actionListener(..... e){
            if (e.getSource() == bCancel)
               value = null;
            else if (e.getSource() == bOk)
               value = //generate the string
            dispose();
    }

  • Can I using Oracle Password filter without using DIP?

    Hi expert,
    Can I using Oracle Password filter without using DIP?
    I installed OID 1.1.1.5.0 and AD MS 2008 + Password Filter without other configuration about DIP.
    While Install password filter, I use 'sAMAccountName' as Source Attribute (Microsoft Active Directory) and 'orclSAMAccountName' as Target Attribute (Oracle Internet Directory) instead of using objectGUID.
    My Scenario test
    1. setup password filter follow by 20 Deploying the Oracle Password Filter for Microsoft Active Directory
    2. create user in AD
    3. create user in OID
    4. reset password in AD
    I found that it can't send password from AD to OID.
    See log below
    OID Base DN is ---->
    dc=ksso,dc=com
    About to retrive connection
    Got the Connection
    Inside Add Parent
    About to add node
    Node Added
    retval is NOT success
    Out of Add Parent
    Domain String -->
    KSSO.LOCAL
    User Domain String -->
    [email protected]
    Inside OID Search User sgslodac
    About to fire the search request
    TEST BASE -->
    dc=ksso,dc=com
    Password Update Failed. No record to update
    Search did not reterive any data
    Writing data into persistence store
    INSIDE IF PERSISTENT STORE
    Inside sgsladds::sgslperwriteData YOOOO
    Inside sgsladac c-tor
    AD Host
    10.20.5.60
    AD Port
    389
    AD Base DN
    DC=KSSO,DC=LOCAL
    Only dataattribute
    Got Registry enteries
    contact
    description
    Got Entiredn
    OU=orclpwfKSSO.LOCAL,DC=KSSO,DC=LOCAL
    Encrypted record already exists in Datastore
    Already Exists
    Encrypted record already exists in Datastore
    Already Exists
    Inside sgsladdsSearchUser
    Firing Search Request
    AD search for a user objectGUID is successfull
    Count success
    Search result fetched
    0:437 7 monsoft314 420 AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAlfdA8eazxkaNLy8BEBQHKgAAAAAmAAAAUABhAHMAcwB3AG8AcgBkACAARQBuAGMAcgBwAHQAaQBvAG4AAAAQZgAAAAEAACAAAAALknXvaho0gPrrP34AQqdBSMLHHcVupTrFuuN0lQdV0QAAAAAOgAAAAAIAACAAAAAKxX3FGNQ/lJBjETm3pRiveLFRiiCwxbrf3UNlQtk5C0AAAAC66Ip1jAzC6U1gTVP9LHETW1MwEfzxSXHcCny9wy7pFyDlLtmpnP1nGYUegAMxvJTu5yGmciBMmfZAgS1Oan3PQAAAAETSu3JcNAkdSqm2E1zxSWxClWrBid/eLHpbasjHo5cLgkGjzI6+UWNHzhfOf86wJ0uuex+++0ttFRzzMEf9atE=
    Inside sgsladds::sgsladdsgetData NEW Look
    0:437 7 monsoft314 420 AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAlfdA8eazxkaNLy8BEBQHKgAAAAAmAAAAUABhAHMAcwB3AG8AcgBkACAARQBuAGMAcgBwAHQAaQBvAG4AAAAQZgAAAAEAACAAAAALknXvaho0gPrrP34AQqdBSMLHHcVupTrFuuN0lQdV0QAAAAAOgAAAAAIAACAAAAAKxX3FGNQ/lJBjETm3pRiveLFRiiCwxbrf3UNlQtk5C0AAAAC66Ip1jAzC6U1gTVP9LHETW1MwEfzxSXHcCny9wy7pFyDlLtmpnP1nGYUegAMxvJTu5yGmciBMmfZAgS1Oan3PQAAAAETSu3JcNAkdSqm2E1zxSWxClWrBid/eLHpbasjHo5cLgkGjzI6+UWNHzhfOf86wJ0uuex+++0ttFRzzMEf9atE=
    Encoded Data Extracted in sgsladdsgetData
    437 7 monsoft314 420 AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAlfdA8eazxkaNLy8BEBQHKgAAAAAmAAAAUABhAHMAcwB3AG8AcgBkACAARQBuAGMAcgBwAHQAaQBvAG4AAAAQZgAAAAEAACAAAAALknXvaho0gPrrP34AQqdBSMLHHcVupTrFuuN0lQdV0QAAAAAOgAAAAAIAACAAAAAKxX3FGNQ/lJBjETm3pRiveLFRiiCwxbrf3UNlQtk5C0AAAAC66Ip1jAzC6U1gTVP9LHETW1MwEfzxSXHcCny9wy7pFyDlLtmpnP1nGYUegAMxvJTu5yGmciBMmfZAgS1Oan3PQAAAAETSu3JcNAkdSqm2E1zxSWxClWrBid/eLHpbasjHo5cLgkGjzI6+UWNHzhfOf86wJ0uuex+++0ttFRzzMEf9atE=
    Moving out sgsladdsgetData
    Encoded Data Extracted
    437 7 monsoft314 420 AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAlfdA8eazxkaNLy8BEBQHKgAAAAAmAAAAUABhAHMAcwB3AG8AcgBkACAARQBuAGMAcgBwAHQAaQBvAG4AAAAQZgAAAAEAACAAAAALknXvaho0gPrrP34AQqdBSMLHHcVupTrFuuN0lQdV0QAAAAAOgAAAAAIAACAAAAAKxX3FGNQ/lJBjETm3pRiveLFRiiCwxbrf3UNlQtk5C0AAAAC66Ip1jAzC6U1gTVP9LHETW1MwEfzxSXHcCny9wy7pFyDlLtmpnP1nGYUegAMxvJTu5yGmciBMmfZAgS1Oan3PQAAAAETSu3JcNAkdSqm2E1zxSWxClWrBid/eLHpbasjHo5cLgkGjzI6+UWNHzhfOf86wJ0uuex+++0ttFRzzMEf9atE=
    Incrementing the MAX_RETRY LIMIT:
    1
    numretries ====== 
    1
    Inside sgslcodsupdateChild
    1:437 7 monsoft314 420 AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAlfdA8eazxkaNLy8BEBQHKgAAAAAmAAAAUABhAHMAcwB3AG8AcgBkACAARQBuAGMAcgBwAHQAaQBvAG4AAAAQZgAAAAEAACAAAAALknXvaho0gPrrP34AQqdBSMLHHcVupTrFuuN0lQdV0QAAAAAOgAAAAAIAACAAAAAKxX3FGNQ/lJBjETm3pRiveLFRiiCwxbrf3UNlQtk5C0AAAAC66Ip1jAzC6U1gTVP9LHETW1MwEfzxSXHcCny9wy7pFyDlLtmpnP1nGYUegAMxvJTu5yGmciBMmfZAgS1Oan3PQAAAAETSu3JcNAkdSqm2E1zxSWxClWrBid/eLHpbasjHo5cLgkGjzI6+UWNHzhfOf86wJ0uuex+++0ttFRzzMEf9atE=
    Encrypted record data updated successfully
    Inside sgsladac destructor
    Inside sgslodac destructor
    Inside sgsladac destructor
    Password updation failed in child process
    Moving out sgslpascsynchDataStoreWithOID
    About to UNBIND datastore after processing the Records
    Deleting datastore object pointer
    ***********Inside sgslldpcopenLDAPConnection****************
    REG BASE Key === 
    SYSTEM\CurrentControlSet\Control\Lsa\orclidmpwf\OIDConfig
    OID Host Key
    OIDHost
    OID Host Value ====
    Oracle.OID
    am I missing something?
    or this scenario can't work without DIP?
    Thank you
    Noraset,

    Hi,
    As yingkuan had provided nice link for understanding...
    Why you od this doubt... Since, When you are holding two different Database, then you can carry out stream replicaiton, the bottom line is on the on two different DB's.. .still if they are on same host.. !!
    - Pavan Kumar N

  • Net use incorrect password

    Hi everybody...
    Hopefully someone can help me. Since mapping network drives persistant leads to massive slowdowns in explorer.exe if some of the drives aren't connected I wanted to create a simple batch file to map and unmap the network drives.
    Thats my batch to map them:
    if not exist R net use R: /USER:"domain"\"user" \\"Server"\"Share"\"Folder" "password"
    If I leave out "password" and replace it with * I will be asked for the correct password and by typing it in the drive is connected properly.
    Somehow my specific password, which I would love to set in the batch itself so it isn't necessary to always type it, doesnt seem to be recognized correctly by cmd.
    My password contains the following symbols "=%=%" but in the cmd that opens when i click on my batch it is only shown "=%"
    Is there a way to let the cmd know that it has to use the whole term as pw. I have the feeling it is somehow confused and thinks it is a equation or something like that.
    Can I put the pw in () or anything to force the exact sequenze of letters, numbers and symbols?
    Thanks in advance!!

    Hi,
    Might we consider to change the password so as to make the scripts work as a workaround?
    For how CMD identify the characters, if we have used the password with "" or '', CMD would take it as a string type,  special characters that must be preceded by the escape character (^) or quotation marks when you pass them as arguments.
    For more information regarding the special characters, please see:
    Command shell overview
    As I am not familiar with the cmd commands, we may also seek help at the scripting guys forum and see if experts there would share some insights:
    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG
    Best regards
    Michael Shao
    TechNet Community Support

  • How can I use ONE password that serves to open up multiple mozilla functions instead of entering & reentering password?

    Firefox just reset itself. Before that, I could enter a safety site, type in 1 password, and thereafter have my username and gmail password automatically display in yellow - saving my entering those two items each time. Since the Firefox reset, I can't figure out how to reset Firefox or Google or whoever it is to do what it used to do. Thanks

    Hello ericmorrel, see : [https://support.mozilla.org/en-US/kb/password-manager-remember-delete-change-passwords Password manager - Remember, delete and change saved passwords in Firefox]
    see also : [https://support.mozilla.org/en-US/kb/use-master-password-protect-stored-logins Use a Master Password to protect stored logins and passwords]
    thank you

  • JCOerror: This system does not let you log on using a password

    Hi,
    "JCOerror: This system does not let you log on using a password"
    This is the error message I get from MII tries to connect to the Production ECC using my credentials to perform a BAPI call.
    These credentials work fine interactively (using the SAP GUI) and for BAPI calls from MII on SAP Development instances.
    I can interpret this message in two ways:
    - My login can not log on using password (though I can interactively)
    - The server does not allow logging on using password only. (It might require to pre-authorize the connecting server as well).
    I guess my question can be if this error requires adding additional rights to my login for the production environment, or if this is a global SAP setup for this system?  Or something else?
    In either way, what is required to have this work?
    Thanks.

    Hi,
    Kindly try the following options.
    Try executing the BAPI seperately in se37, using your login credentials.
    Check whether RFC is enabled for the BAPI.
    Check whether the SAP server is details are furnished correctly in "SAP Server"(available under "Data Services") editor.
    We can ensure this by checking the connection status link in xMII.(Link is available under "Data Services").
    If connection status is "Running" then SAP server setting configuration is fine. Else it is not configured properly.
    Try executing the BAPI in BLS(Business Logic Services) using JCO connector.
    I believe if any one of these scenarios fail then "Proxy Error" might thrown.
    Thanks
    Rajesh Sivaprakasam

  • This system does not let you log on using a password

    hi all,  i  am very new to sap basis. i have changed the below profile parameters in RZ10.
    login/min_password_length=3
    login/min_password_lowercase=1
    login/min_password_uppercase=1
    login/min_password_digits=2
    login/min_password_specials=1
    after changing values i restarted the Instance. But the problem is when i am trying to login to the system it is showing  an error message : "This system does not let you log on using a password". I know why  this error occurs...
    but how to resolve this error? plz Help.
    Thanks in advance

    login/min_password_length=3
    login/min_password_lowercase=1
    login/min_password_uppercase=1
    login/min_password_digits=2
    login/min_password_specials=1
    The correct parameter for Min password Lenght is login/min_password_lng.
    You can change this at OS level restart and see how it goes...
    Regards
    Juan

  • Not able to open mail from my mac, gmail repeatedly asking for password. but using same password able to open gmail on safari

    not able to open mail from my mac, gmail repeatedly asking for password. but using same password able to open gmail on safari

    okay well they got me to take out some .plist files to see if that would help it didn't. I'm not sure what ones that they deleted for my self maybe someone here would be abel to tell you what ones to take out but didn't work the one that came close to working was this going into keychain and deleting the account(s) then reading them again.
    if you are to do this please back up first with Time Machine. You can do this with a usb drive.
    Okay so go back to where you had internet accounts and make sure mail is shut. click the - on the account your having problems with then quit system preferences.
    Okay so then press cmd and space bar at the same time then type 'keychain access' into the search then click on 'keychain access'
    once it is open go to the top of the window and put your email address that you are having problems with.
    once you have put in your full email, have a look at what comes up i deleted things in the kind colome with 'internet password' and anything with under name that had smtp.gmail.com or imap.gmail.com so it would look like this, map.gmail.com - internet password.
    right click and delete them. make sure not to touch any other files that dont say them things on them.
    Once you have done this quit keychain access and then restart the computer, once the computer is restarted go back to system preferences and internet accounts and re-add the account.
    Hope this helps. if something is not clear just ask.

  • I'm installing the new OS and iPhone is asking for a password to "restore" my iPhone, but I've never used a password for the phone and don't know what it is!

    I'm installing the new OS and iPhone is asking for a password to "restore" my iPhone, but I've never used a password for the phone and don't know what it is!  Can anyone help??

    You selected Encrypt iPhone Backups in iTunes.  Then you entered a password.
    It would be that specific password it is asking for.
    See here:
    https://discussions.apple.com/thread/3284065?start=0&tstart=0

  • Special characters in XML structure when prepared using String

    Hi,
       I am preparing an XML structure using 'String'. I print the prepared XML structure in the server log. Issue is that I am seeing extra characters([[ and ]]) that I am not printing.
    Please let me know how to get rid of those.
    Code Excerpt
            String xmlHeader = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
            String lsb_xmlcon = xmlHeader;
            logger.info("ReqXMLString Process  1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.1  --->" + lsb_xmlcon);
            lsb_xmlcon = lsb_xmlcon +("<REQUEST>");
            lsb_xmlcon = lsb_xmlcon +("\n");
            logger.info("ReqXMLString Process  1.2  --->" + lsb_xmlcon);
    Log
    ReqXMLString Process  1  ---><?xml version="1.0" encoding="utf-8" ?>
    ReqXMLString Process  1.1  ---><?xml version="1.0" encoding="utf-8" ?>[[
    ReqXMLString Process  1.2  ---><?xml version="1.0" encoding="utf-8" ?>[[
    <REQUEST>
    Thanks,
    Message was edited by: 996913
    This issue is observed only while running the code in server, not from Jdev.
    When we append the additional tags without new line character, "\n", there are no extra characters being added. Also, in other case also. where we used "Marshaller" to prepare the XML, we have seen this issue.
    After we set the below property to false, we got rid of the extra characters.
                            jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, false);
    Apparently the insertion of new line when the code runs on server(Weblogic 10.3.6.0) is creating the issue.
    Please let me know if anyone has come across a similar scenario.
    Thanks,

    I am building this XML in a servlet so ,right, DOM does process XML (even though a valid HTML file can be loaded into a DOM object) but if you build XML using DOM then write the XML out using PrintWriter and Transformer objects this will cause the XML to print out in your browser. If you view source on this XML you will see that the DOM object has translated all special characters to there &xxxx; equivalent. For a example: when the string (I know "cool" java) gets loaded into a attribute using the DOM object then wrote back out it looks like (I know &xxx;cool&xxx; java) if you view the source in your browser. This is what it should do, but the DOM object is not change the � to the "&xxxxx;". This servlet is acting as a gateway between a Java API and a windows asp. The asp will call the servlet expecting to get XML back and load it directly into a DOM object. When the windows DOM object gets the xml that I am returning in this servlet is throws a exception "invalid character" because the � was not translated to &xxxx; like the other characters were. According to the book HTML 4 in 24 hours (and other references) the eacute; or #233; are how you say "�" in HTML or XML. How do you say it?

  • How to retrieve IndividualStrings from a txt file using String Tokenizer.

    hello can any one help me to retrieve the individual strings from a txt file using string tokenizer or some thing like that.
    the data in my txt file looks like this way.
    Data1;
    abc; cder; efu; frg;
    abc1; cder2; efu3; frg4;
    Data2
    sdfabc; sdfcder; hvhefu; fgfrg;
    uhfhabc; gffjcder; yugefu; hhfufrg;
    Data3
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    val1; val2; val3; val4; val5; val6;
    i need to read the data as an individual strings and i need to pass those values to diffarent labels,the dat in Data3 i have to read those values and add to an table datamodel as 6 columns and rows depends on the data.
    i try to retrieve data using buffered reader and inputstream reader,but only the way i am retrieving data as an big string of entire line ,i tried with stringtokenizer but some how i was failed to retrive the data in a way i want,any help would be appreciated.
    Regards,

    Hmmm... looks like the file format isn't even very consistent... why the semicolon after Data1 but not after Data2 or Data3??
    Your algorithm is reading character-by-character, and most of the time it's easier to let a StringTokenizer or StreamTokenizer do the work of lexical analysis and let you focus on the parsing.
    I am also going to assume your format is very rigid. E.g. section Data1 will ALWAYS come before section Data2, which will come before section Data3, etc... and you might even make the assumption there can never be a Data4, 5, 6, etc... (this is why its nice to have some exact specification, like a grammar, so you know exactly what is and is not allowed.) I will also assume that the section names will always be the same, namely "DataX" where X is a decimal digit.
    I tend to like to use StreamTokenizer for this sort of thing, but the additional power and flexibility it gives comes at the price of a steeper learning curve (and it's a little buggy too). So I will ignore this class and focus on StringTokenizer.
    I would suggest something like this general framework:
    //make a BufferedReader up here...
    do
      String line = myBufferedReader.readLine();
      if (line!=null && line.trim().length()>0)
        line = line.trim();
        //do some processing on the line
    while (line!=null);So what processing to do inside the if statement?
    Well, you can recognize the DataX lines easily enough - just do something like a line.startsWith("Data") and check that the last char is a digit... you can even ignore the digit if you know the sections come in a certain order (simplifying assumptions can simplify the code).
    Once you figure out which section you're in, you can parse the succeeding lines appropriately. You might instantiate a StringTokenizer, i.e. StringTokenizer strtok = new StringTokenizer(line, ";, "); and then read out the tokens into some Collection, based on the section #. E.g.
    strtok = new StringTokenizer(line, ";, ");
    if (sectionNo==0)
      //read the tokens into the Labels1 collection
    else if (sectionNo==1)
      //read the tokens into the Labels2 collection
    else //sectionNo must be 2
      //create a new line in your table model and populate it with the token values...
    }I don't think the delimiters are necessary if you are using end-of-line's as delimiters (which is implicit in the fact that you are reading the text out line-by-line). So the original file format you listed looks fine (except you might want to get rid of that rogue semicolon).
    Good luck.

  • HT204053 I cannot use the password to update apps on my second IPhone.  It only works on one of the phones. They both have the same Apple ID and password.

    I cannot use the password to update apps on my second IPhone.  It only works on one of the phones. They both have the same Apple ID and password.

    If it really does not work, change your password here https://appleid.apple.com (Manage account) and try to add the account again. I hope it helps.

  • I have two iPads and giving one to my grandson. Using my Apple id for both, can we use different passwords to access our "own" apps. Also I don't want the downloaded App to go to both iPads. Been looking for hours for an explanation! Thanks for any help.

    I have two iPads and giving 1st gen. to my grandson. Using my Apple idI for both... can we use different passwords to access our "own" apps. Also I don't want the downloaded App to go to both iPads. Been looking for hours for an explanation! Thanks for any help.

    Look at this link.
    Giving your former iPad to a spouse or family member: the quick guide
    http://www.tuaw.com/2012/03/17/giving-your-former-ipad-to-a-spouse-or-family-mem ber-the-quick/
    How to Share a Family iPad
    http://www.macworld.com/article/1163347/how_to_share_a_family_ipad.html
    Using iPhone, iPad, or iPod with multiple computers
    http://support.apple.com/kb/ht1202
    iOS & iCloud Tips: Sharing an Apple ID With Your Family
    http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/
    How To Best Use and Share Apple IDs across iPhones, iPads and iPods
    http://www.nerdsonsite.com/blog/2012/06/07/help-im-appleid-confused/
     Cheers, Tom

  • I keep getting a message "The MobileMe IMAP server ... rejected the password for ...."  I can use that password when I go to iCloud, but my e-mails won't download to my computer.  What's the mix-up?

    I keep getting a message "The MobileMe IMAP server ... rejected the password for ...."  I can use that password when I go to iCloud (and to this discussion), but my e-mails won't download to my computer.  What's the mix-up?

    If the setting is greyed out perhaps you have restrictions enabled that would prevent someone from changing accounts. Settings>General>Restrictions>Allow Changes>Accounts.

Maybe you are looking for

  • Heirarchical ALV with OOPS

    Can anyone help me with the code of Heirarchical ALV with OOPS in module pool programming.

  • Interfaces to Finanacial systems using OWB 9i

    Hi, We are in the process on designing a datawarehouse. Please let me know if Oracle ware house builder provides interfaces to the follwing financial systems :- 1)Great Plains V6.0 2)Sun 4.2.6 3)Oracle Financials 11.5.8 4)Navision 2.6 5)Sage Line 100

  • Book Printing..How Long Does It Take?

    I ordered a mini book on Feb. 12th and the status page still says "Printing". How long does a book order usually take (from the U.S.)? I'm using the Express option. Thanks.

  • Some devices won't connect to wifi network after resetting network settings to default

    Hi all, I had to restore to the default settings on my 4th generation Time Capsule today and now half of our devices will not connect to the wifi network.  The macbook pro (mid 2010 OS 10.9.4) that I used to reset the time capsule with and my iPhone

  • Advice on early 2009

    Hi, I now have an early 2009 Imac, which was an upgrade for me from an old power book. The Imac is currently running 10.5.8, a clean install was done when I got the machine. I purchased disk to upgrade to Snow Leopard with the intention of then upgra