title: Possible to open two persistent connections to different remote MySQL servers using JAVA sql?
body: <p>So I'm trying to run a code which creates a table in a remote MySQL server, by referencing tables located in a different MYSQL server. The server that I am trying to create a table in has space limitations, and the tables that are being referenced are very large, so they have to be kept on a different remote server.</p>
  
  <p>I'm trying to find a way to set up persistent connections to both databases at the same time (using JDBC libraries) so I don't have to keep buffering small numbers of lines of data... I'd like to be able to just reference the data directly.</p>
  
  <p>E.g. 
  Database A contains the data I am referencing, and Database B is where I am creating the new tables.
  say the table I am referencing in Database A is 1,000,000 lines. Instead of, say, opening a connection to Database A, buffering 10,000 lines, closing the connection, opening a connection to Database B, writing the that database, deleting my buffer, and repeating...</p>
  
  <p>I'd like to just have a persistent connection to database A, so every write to Database B can reference the data in Database A. </p>
  
  <p>Is this possible? I've tried several ways (mostly by creating new connection objects that only refresh if the connection breaks), and I can't seem to get this idea working.</p>
  
  <p>Has anyone done something similar to this using JDBC? If so, It would be much appreciated if you could point me in the right direction, or tell me how you managed to get it working.</p>