title: Fetching data from database and store it into an array using JavaScript
body: <p>i'm trying to fetch data from oracle database and store it into an array using JavaScript . but the output I'm getting "undefined". how can i fix it?Can anyone help me.</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
      function getdata(){
                  var con= new ActiveXObject('ADODB.Connection');
                  var connectionString="Provider= OraOLEDB.Oracle;User id=SYSTEM;Password=xxxx;datasource=ORA";
                  con.Open(connectionString);
  
                  var rs=new ActiveXObject('ADODB.Recordset');
                  rs.Open("select W_DATE,DATA from xet", con);
                  var data=[];
                  while(!rs.eof)
                  {
                      document.write(data.push[rs(0),rs(1)]);
                      rs.movenext;
                  }
  
                  rs.close;
                  con.close;
              }
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onLoad="getdata()"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>here is my data= </p>
  
  <p>w_date              data</p>
  
  <p>1/4/2015 9:27         20.1</p>
  
  <p>1/4/2015 18:52        18.2</p>
  
  <p>2/4/2015 19:00        18.3</p>
  
  <p>2/4/2015 21:25        15.1</p>
  
  <p>I want to get the output as [[1/4/2015 9:27,20],[1/4/2015 18:52,18],....]</p>