Ms access into array

hi all,
How to import a list of phone numbers from ms access, excel sheet into an array .. ?
Message was edited by:
devsu

By using JDBC you can bring all your phone numbers in to an array
now i am sending just sample program for accessing number from excel look into it..
import java.io.*;
import java.sql.*;
class MyP1
public static void main(String cc[])
  try{
  DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
  Connection con = DriverManager.getConnection("jdbc:odbc:GsrCBook1","","");
  Statement st = con.createStatement();
  ResultSet rs = st.executeQuery("select Number from [Sheet1$]");
  while(rs.next())
   System.out.println(rs.getString(1));
  catch(Exception e)
  {System.out.println(e);}
first you need to create User/System DSN in your data source
for details how to create DSN please search http://www.javaworld.com/javaworld/javaqa/2001-06/04-qa-0629-excel.html

Similar Messages

  • How to get the record set into array?

    Hi,
    I want to get the record set into array in the procedure and do the processing of the array later in procedure.
    below is the stored procedure i am working on:
    procedure bulk_delete_group(p_group_id in Array_GroupListID) as
    begin
    for i in p_group_id.first..p_group_id.last loop
    --Here I have to get the list of user id before deleting group
    SELECT user_id into *<SOME ARRAY>* FROM group_members WHERE group_id = p_group_id(i);
    DELETE group WHERE group_id = p_group_id(i);
    --Process the user id array after group deletion..
    end loop;
    end bulk_delete_group;
    Thanks in advance
    Aditya

    Something like this ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>
    satyaki>select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455         10
          7777 SOURAV     SLS                  14-SEP-08      45000       3400         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       4450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       7000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
    13 rows selected.
    Elapsed: 00:00:02.37
    satyaki>
    satyaki>create type np is table of number;
      2  /
    Type created.
    Elapsed: 00:00:03.32
    satyaki>
    satyaki>Create or Replace Procedure myProc(myArray np)
      2  is
      3    i   number(10);  
      4    rec emp%rowtype;  
      5  Begin  
      6    for i in 1..myArray.count
      7    loop  
      8      select *  
      9      into rec 
    10      from emp 
    11      where empno = myArray(i); 
    12     
    13      dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename); 
    14    end loop; 
    15  End myProc;
    16  /
    Procedure created.
    Elapsed: 00:00:00.88
    satyaki>
    satyaki>
    satyaki>declare
      2    v np:=np(9999,7777);  
      3  begin  
      4    myProc(v);  
      5  end;
      6  /
    Employee No:9999 Name:SATYAKI
    Employee No:7777 Name:SOURAV
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.30
    satyaki>Regards.
    Satyaki De.

  • Splitting and type casting huge string into arrays

    Hello,
    I'm developing an application which is supposed to read measurement files. Files contain I16 and SGL data which is type casted into string. I16 data is data from analog input and SGL is from CAN-bus data in channel form. CAN and analog data is recorded using same scan rate.
    For example, if we have 6 analog channels and 2 CAN channels string will be (A represents analog and C represents CAN):
    A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 .... and so on
    Anyway, I have problems reading this data fast enough into arrays. Most obvious solution to me was to use shift registers and split string in for loop. I created a for loop with two inner for loops. Number of scans to read from string is wired to N terminal of the outermost loop. Shift register is initialized with string read from file.
    First of the inner loops reads analog input data. Number of analog channels is wired to its N terminal. It's using split string to read 2 bytes at a time and then type casts data to I16. Rest of the string is wired to shift register. When every I16 channel from scan is read, rest of the string is passed to shift register of the second for loop.
    Second loop is for reading CAN channels. It's similar to first loop except data is read 4 bytes at a time and type casted to SGL. When every CAN channel from scan is read, rest of the string is passed to shift register of the outermost loop. Outputs of type cast functions are tunneled out of loops to produce 2D arrays.
    This way reading about 500 KB of data can take for example tens of seconds depending on PC and number of channels. That's way too long as we want to read several megabytes at a time.
    I created also an example with one inner loop and all data is type casted to I16. That is extremely fast when compared to two inner loops!
    Then I also made a test with two inner loops where I replaced shift register and split string with string subset. That's also faster than two inner loops + shift register, but still not fast enough. Any improvement ideas are highly appreciated. Shift register example attached (LV 7.1)
    Thanks in advance,
    Jakke Palonen
    Attachments:
    String to I16 and SGL arrays.vi ‏39 KB

    OK, there is clearly room for improvement. I did some timing and my two above suggestions are already about 100x faster than yours. A few teeaks led to a version that is now over 500x faster than the original code.
    A few timings on my rather slow computer (1GHz PIII Laptop) are shown on the front panel. For example with 10000 scans (~160kB data as 6+2) my new fastest version (Reshape II) takes 14 ms versus the original 7200ms! It can do 100000 scans (1.6MB data) in under 200 ms and 1000000 scans (15MB data) in under 2 seconds.
    I am sure the code could be further improved. I recommend the Reshape II algoritm. It is fastest and can deal with variable channel counts. Modify as needed.
    Attached is a LabVIEW 7.1 version of the benchmarking code, containing all algorithms. I have verified that all algorithms produce the same result (with the limitation that the cluster version only works for 6*I16+2*SGL data, of course). Remember that the reshape function is extremely efficient, because it does not move the data in memory. I have some ideas for further improvements, but this should get you going.
    Message Edited by altenbach on 08-05-2005 03:06 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    StringI16SGLCastingTimer.png ‏48 KB
    StringtoI16andSGLArraysMODTimer.vi ‏120 KB

  • Can you import Access into Oracle 10g Express Edition?

    Hi all,
    I know you can import files from Access into some other versions of Oracle, but is it possible with 10g XE?
    I've been looking at all the tools in my browsers and none seem to do it.
    I guess I'll need to convert the tables into text, and then from text into Oracle?
    Thanks

    Why not give SQLDeveloper's migration a shot?
    You can get it for free here.
    http://www.oracle.com/technology/software/products/sql/index.html
    I've never personally done it, but it doesn't look to mind bending :)
    http://www.oracle.com/technology/obe/11gr1_db/appdev/msamigrate/msamigrate.htm
    Should work fine with XE.

  • How to record sound into array using DAQ ?

    Hi to everyone
    Im last year student , im using LABVIEW for the first time.
    i have an myDAQ , i need to record audio go through the analog ports/AUDIO INPUT of the myDAQ, into array, for later singal proccesing.
    its for my final project.

    First, Learn to use LabVIEW with myDAQ is a series of videos.  To quote the Introduction,
    The Learn to LabVIEW with MyDAQ provides fundamental LabVIEW knowledge for a great out of the box experience with your MyDAQ. Each unit provides a set of videos to allow you to learn at your own pace and review material an unlimited number of times. As well, most videos are accompanied by minor exercises which will help drive home important topics and challenge you along the way.
    View the videos, do the exercises, and I suspect many of your questions will be answered.  If you write some LabVIEW code and have a problem, come back, show us your code, and explain the problem.
    Bob Schor

  • How to put data from database into array

    I need to answer hot to put data from database directly into array.
    I tried like the code below but the error message said: java.lang.ArrayIndexOutOfBoundsException: 0, and it points to this line: numbers [row][0]= rs.getString("ID");
    Hope you can help.
    ResultSet rs = stmt.executeQuery(query);
         int row=0;
         String [] [] numbers=new String [row][10];
         // output resultset
         while ( rs.next() )
              numbers [row][0]= rs.getString("ID");
              numbers [row][1]= rs.getString("name");
         row++;
         // close resultset
         rs.close();
    thanks,Devi

    The exception is been thrown simply because you assigned '0' to the 'row' variable, indicating a zero length of the array. In fact you should assign the row count to it.
    After all, don't do that. Make use of the Collection framework and map the ResultSet to a Collection of DTO's.
    List<User> users = new ArrayList<User>();
    while (resultSet.next()) {
        User user = new User();
        user.setID(resultSet.getString("ID"));
        user.setName(resultSet.getString("name"));
        users.add(user);
    }

  • Access XML array inside MovieClip. How ?!

    Hello,
    Ok, I have a code to load Multiple XML files at once and save it to an array named xmlDocs like this:
    //each xml file to load
    var xmlManifest:Array = new Array();
    //the xml for each file
    var xmlDocs:Array = new Array();
    //the xml file with all the xml files to be loaded.
    var RSSWidgetRequest:URLRequest = new URLRequest("xml/rss-widget.xml");
    var urlLoader:URLLoader = new URLLoader();
    var docsXML:XML = new XML();
    docsXML.ignoreWhitespace = true;
    //when COMPLETE is loaded run function loadDocs
    urlLoader.addEventListener(Event.COMPLETE,loadDocs);
    urlLoader.load(RSSWidgetRequest);
    //load the docs
    function loadDocs(event:Event):void {
    docsXML = XML(event.target.data);
    //m21m is the name space defined in my doc m21m:feed... you don't need one.
    var m21m:Namespace=docsXML.namespace("m21m");
    //get all the feed nodes
    var feeds=docsXML..m21m::feed;
    for (var i:int=0; i < feeds.length(); ++i) {
      //add the feed to the xmlManifest array
      xmlManifest[xmlManifest.length] = feeds[i].attribute("feed");
    //load the xml for each doc
    loadXMLDocs();
    //load all the XML files
    function loadXMLDocs() {
    if (xmlManifest.length>xmlDocs.length) {
      var RSSURL:URLRequest = new URLRequest(xmlManifest[xmlDocs.length]);
      var urlLoader:URLLoader = new URLLoader();
      var xmlDoc:XML = new XML();
      xmlDoc.ignoreWhitespace = true;
      urlLoader.addEventListener(Event.COMPLETE,getDoc);
      urlLoader.load(RSSURL);
      function getDoc(event:Event) {
       xmlDoc = XML(event.target.data);
       //hold all the xml of each doc in an array
       xmlDocs[xmlDocs.length] = xmlDoc;
       loadXMLDocs();
    } else {
      trace(xmlDocs)
      //do something when all xml is loaded
    How i can access xmlDocs array difinte on main timeline from insted MovieClip...?!
    Regards,

    It does not work. I used this code to display the data:
    var xmlList:XMLList;
    var xmlData:XML = new XML(MovieClip(this.parent.parent).xmlDocs[0].data);
    xmlList = xmlData.class10;
    sId10_btn.addEventListener(MouseEvent.CLICK, displayData);
    function displayData(evt:MouseEvent):void
              for each (var grade:XML in xmlList)
                        if (myTextField.text == grade.st_id.text())
                                  content10.sName10.text = grade.st_name;
                                  content10.sQuran10.text = grade.quran;
                                  content10.sIslamic10.text = grade.islamic;
                                  content10.sArabic10.text = grade.arabic;
                                  content10.sEnglish10.text = grade.english;
                                  content10.sMath10.text = grade.math;
                                  content10.sChemistry10.text = grade.chemistry;
                                  content10.sPhysics10.text = grade.physics;
                                  content10.sBiology10.text = grade.biology;
                                  content10.sSocial10.text = grade.social;
                                  content10.sSport10.text = grade.sport;
                                  content10.sComputer10.text = grade.computer;
                                  content10.sNesba10.text = roundNumber(Number(grade.nesba), 2);

  • Insert element into array problem

    Hi,
    I have problem about how to insert value into an array. here is one section, could anyone help me to insert input value into array and delete the first value in the array. Gap means to fill in code
    void Ins(String name)
    // Insert name or increment its multiplicity.
    // If the bag is full remove the oldest entry.
    int i; // Running index on BagName
    int target; // if target < n then name.equals(BagName[target]);
    // else target == n
    Date EntryDate; // Current date and time
    // Get current date and time
    EntryDate = new Date();
    BagDate[n] = EntryDate.toString();
    Mult[n] = n+1;
    BagName[n] = name;
    n++;
    // Search bag for name
    // Gap 2
    // Assertion: target < n => name.equals(BagName[target])
    // else target == n
    // Update Mult if target < n
    // Gap 3
    // Make room for and insert name if target not found
    } // Ins(String name)
    Message was edited by:
    sibojava
    Message was edited by:
    sibojava

    Do you have several accounts?
    See this thread, it's the same question:
    http://forum.java.sun.com/thread.jspa?threadID=5143232
    Kaj

  • XML going into Arrays is killing my movie

    I'm loading a large xml file into flash.
    I think the amount of data going into Arrays is killing my
    move. So what are the work arounds?

    If the built-in XML parser is getting bogged because there is
    too much to
    handle, you ought to try loading smaller chunks of data.
    "mcshaw" <[email protected]> wrote in
    message
    news:e7ueac$md0$[email protected]..
    > I'm loading a large xml file into flash.
    > I think the amount of data going into Arrays is killing
    my move. So what
    are the work arounds?

  • How to access complex arrays/types in a class

    public class VirusScanMessage {
    public byte[] fileContent;
    public int fileSize;
    public String messages;
    public String datLocation;
    jclass clazz = env->FindClass("VirusScanMessage");
    // get field
    jfieldID byteArrayField = env->GetFieldID(clazz,"fileContent","[b");
    // get the byteArray object
    jbyteArray byteArray = env->GetObjectField(object,byteArrayField);
    // get array length
    jsize fileContentLength = env->GetArrayLength(byteArray);
    jbyte * fileContent = env->GetByteArrayElements(byteArray,0);
    // do stuff
    // release array
    env->ReleaseByteArray(byteArray,fileContent,0);thats the normal way but how to access the arrays if they are complex like this(struct1,class2)?:
    public class VirusScanMessage {
    public struct1[] fileContent;
    public int fileSize;
    public String messages;
    public String datLocation;
    public class2 cl2;
    }

    Note that your code is missing error checking.
    thats the normal way but how to access the arrays if they are complex like this(struct1,class2)?:Retrieve each item from the array as an Object.
    [http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/functions.html#wp21671]

  • Sorting numbers based on value into arrays

    Hi ...
    I currently have a large list of numbers inside an array.. say from 0 to 400 000. They appear in order, but are unevenly spaced.
    Now I'd like to sort these numbers into arrays.
    I want to say: Put all numbers from 0 to 10 into newArray[0]. Put all numbers from 10 to 35 into newArray[1] ....
    In the end I need a two - dimensional array with numbers. Is this possible in LabView ? Can it be done in acceptable speed ?
    Thank you for your help   

    While I haven't figured out a way to do this efficiently, the attached
    shows a method of doing it number by number.  Perhaps the most
    efficient may be to insert Matlab code and use a sort function, or
    equivalent in c.
    To use this to sort multiple numbers, put inside a for loop and build up an array. (also see attached).
    Message Edited by Robert.Bedford on 09-19-2005 08:53 AM
    Attachments:
    single_number_sort.vi ‏18 KB
    array_sort.vi ‏21 KB

  • Westell 7500 - can't remote access into work from laptops (desktop ok), no TiVO connection either

    I successfully set up my "upgraded" Verizon DSL service and modem two weeks ago (have had internet connection on desktop and laptops since) but with that transition I lost the ability to remote access into my work computer from home and to have my TiVo connect to its server.  I am just completely disgruntled at Verizon's request to pay them $89 for the tech support I need to get my new stuff working as well as my old stuff did - and I'm hoping someone out there can help me instead.
    The computer help guys at work said the system at work's port is 3389 and TiVo's support website give as whole list of possible ports (http://support.tivo.com/app/answers/detail/a_id/402/c/105%2C109/r_id/100041).  Is this issue something that can be resolved in the router's port forwarding window?  Is so, how do I set that up correctly?  If it's something else, please tell me what and how!  I've read the Veralink 7500 User Manual and I just can't figure out what I'm doing wrong.
    Thanks in advance for any help that's out there!  And happy Father's Day to you... if that applies!

    I solved the problems myself... and here's the solution in case anyone else would like to keep $89 in their pockets!
    In both instances (remote access to work and connecting to the TiVO network), it is indeed the Port Forwarding feature you need to use in the Versalink 7500 router setup website (people will try to disuade you of this!).  In both cases, I did the following just using different port numbers (depending on what I was trying to get my computer to talk to) and with my computer's firewall on and the router's firewall set to medium.  Sorry I couldn't figure out how to post screen shots in this post... prepare to visualize!
    1. On the "New Port Forwarding Rule" page, click on "create" for #1, pick "host" for #2, and then select the computer your router is connected to in #3 (it might work with one of the other computers selected, but mine worked with the device he router was connected to).
    2. You need to do this step twice - first time select "direction" IN (in #3), second time select "direction" OUT.  On the "Create Port Forwarding Service" page, you can name it whatever you want for #1, keep "port forwading" selected" in #2, in #3 you'll need to figure out (a) if you need to select TCP, UDP, or BOTH for "protocol" (based on the online or manual documentation for the system you're trying to connect with), (b) "global portstart" (c) "global startend" and (d) "base hostport" should also be found in the documentation (see note below for Windows remote access and TiVo port info that worked for me) and they are all the same number (ex., global portstart = 80, global startend = 80, and base hostport = 80), and then (e) select the direction (first time, in; second time, out... remember, computer communication is a two-way street, just like humans!), and (f) leave "port direction" as DST.  Then you need to (g) click apply after you've added all the ports in both directions (my screen started this sequence of freaky flashy glitchy behavior, but apparently that was the fairy dust making the computer magic happen b/c when it was done, my connectivity was restored!).
    3.  The port that worked for me to remote access from Windowss PC to Windows PC was 3389.
    4.  This is the site that had the big list of ports for TiVo, but I think it was ports 80 and 8080 (see the first entry under the troubleshooting port issues) that made the magic happen for me: http://support.tivo.com/app/answers/detail/a_id/402/c/105%2C109/r_id/100041
    I hope this is useful to some others and that you just saved yourself $89 in tech support charges for this irritating little issue... go buy yourself a drink and enjoy the summer!
    Now I'm off to figure out how to back up these router settings based on the less-than-friendly-to-laymen-computer-users Versalink manual.  Wish me luck!

  • Accessing multidimensional Array using JSTL

    Hi there,
    first of all: I'm a newbie to JSP/JSTL :-)
    I'm calling a Java-bean from my JSP. In this bean, a 2-dimensional array is created which holds four values per entry. I can access this array from my JSP w/ following code:
    <jsp:useBean id="feedback" scope="session" class="de.qv.feedback.Feedback"/>
    <% feedback.getDaten()     %>
    <c:forEach var="ids" items="${feedback.bogenListe}">
         <c:forEach var="ids2" items="${ids}">
              <c:out value="${ids2}" />
              </c:forEach>
    </c:forEach>
    Now I want the data to be displayed within a HTML-table. How do I do this? I think I have to access each value one by one, but I don't know how.
    Any hint will be greatly appreciated!
    TIA,
    Buzzy

    Aye, this works :-)
    One more thing: This line accesses each element one by
    one:
    <c:forEach var="value" items="${docs}">
    Is it possible to access a specific value, e.g. only
    the 2nd or 4th element?
    Or do I have to use a counter and <c:if...> to to
    this?No, you can do use the square brackets to get specific values if you want:
    <table>
    <c:forEach var="docs" items="${feedback.bogenListe}">
    <tr>
    //Remember arrays are zero indexed so [0][1][2][3][4] second doc = [1]
    <td><c:out value="${docs[1]}"/></td><c:out value="${docs[3]}"/></td>
    </tr>
    </c:forEach>
    </table>
    //or, if you want all even values, but don't want to manually read them
    <c:forEach var="docs" items="${feedback.bogenListe}">
    <tr>
    <c:forEach var="curr" items="${docs}" begin="1" step="2">
    <td><c:out value="${curr}"/></td>
    </c:forEach>
    </tr>
    </c:forEach>
    </table>
    <td><c:out value="${docs[2]}"/></td><c:out value="${docs[4]}"/></td>
    </td>
    </c:forEach>

  • Extraction of Attendence Punch machine data (MS Access) into Oracle

    Hi all,
    i want to link the our employees timesheet with the Punch machine so for that purpose i nedd to load data from MS ACCESS into oracle8i on daily basis can anyone guide me regarding this. how to extract the data from MS ACCESS daily ??
    Regards
    Rehman

    I do not use or support ACCESS however I know at lot of places have ACCESS front-end's to Oracle so it ought to be possible, if the data does not need a lot of reformatting, to insert the data into Oracle from Access.
    You would also have the option of extracting the data into delimited data files and loading those into Oracle via sqlldr.
    At least one application we have collects data from ACCESS into SQL Server and then sends data to Oracle via a Linked Database.
    The direct insert from ACCESS to Oracle seems best but if you also need data from elsewhere or have extensive reformatting (perhaps normalization) to perform also one of the other techniques may work better.
    HTH -- Mark D Powell --

  • Insert into array function

    Hello,
    How can I add an element to a specific location of an array (row 3 and column 4 for example)?  I can only wire one index input into Insert Into Array function.  
    Thanks 

    If you're trying to replace an existing element, then you should use Replace Array Subset, not Insert Into Array.
    You cannot insert a single element into a 2-D array, because LabVIEW doesn't know how to shift the rest of the array to account for the gap that would appear if you were to do that. If you actually want to insert (and not replace), into a 2D array, then you need to insert an entire row or column, not a single element.

Maybe you are looking for

  • Fix a video that has been recorded in full zoom?

    Is there a way to zoom out during editing or de-pixelate? I must have zoomed in by accident while recording on a tripod. Half the video is fine, half is in full zoom and therefore poo. Is there any way to correct this through editing or something? Or

  • Split cache config file support in 12.1.2?

    With 3.7.1 you could use the coherence-common library from incubator 11 to split cache config files. This was done with the introduce-cache-config XML element: <?xml version="1.0"?> <cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  • Xml Facade creation doubt

    I used the following steps for creating xml facades. However, I am unable to fetch values from the facade and display in jsp. It displays null. Xml Facade: 1. Create schema with the variables that you want to include in the facade. 2. In the bpel_pro

  • OEM Job hanged

    I have executed a simple query (select name from v$datafile) for testing purpose from OEM 10g Grid Control on a database(8.1..7.0) by preparing a job and now it got hanged. I tried to stop the job, kill it, but its not working. Even I killed the sess

  • How to access AdvancedDatagrid column Header information?

    I have an AdvancedDatagrid with custom Column header renderers. column = new AdvancedDataGridColumn("Header Text"); column.headerRenderer = new ClassFactory(PE_FilterHeaderRenderer); MyAdvancedDataGrid.columns = [column]; Within my header renderer cl