title: Spring Framework to Optimize SQL connection?
body: <p>So I am on a webproject that succesfully connects to and reads from an SQL database.  The code that connects to it looks like this.  </p>
  
  <pre><code>//From Here
  var connection = new ActiveXObject("ADODB.Connection") ;
  var connectionstring="Data Source=&lt;server&gt;;Initial Catalog=&lt;catalog&gt;;User ID=&lt;user&gt;;
  Password=&lt;password&gt;;Provider=SQLOLEDB";
  connection.Open(connectionstring);
  var rs = new ActiveXObject("ADODB.Recordset");
  //To Here
  
  rs.Open("SELECT * FROM table", connection);
  rs.MoveFirst
  while(!rs.eof)
  {
  document.write(rs.fields(1));
  rs.movenext;
  }
  
  rs.close;
  connection.close;
  </code></pre>
  
  <p>Simple and effective and I have it working fine.  But those first 4 (marked from here to here) run horribly slow and I have to reconnect every time I need to read from or write to the sql database... which is a lot for my project.  So every time I run this code (which is on every other webpage I am creating in this project) I have to sit and wait for this code to run.</p>
  
  <p>I have been told/ required for the project, to configure the design using javascript and spring framework. Apparently there is either a) a way to hold the connection so I don't have to run this code a every time I hit a go to new page or b) a different method of connection to the SQL database (something to replace those 4 lines of code.  Both of which have to do with my using the Spring Framework.  </p>
  
  <p>I have never used Spring Framework before and need to learn fast.  Been watching their website tutorials but still have no idea what to do or how to do it.  Let me know if have any ideas.  </p>
  
  <p>Please and Thanks.  </p>