connection

Mass update Excel file connection string

北慕城南 提交于 2019-12-05 05:06:50
We have recently changed our SQL Database server and i was wondering if there would be a script or an easier method of updating all the Excel file connection strings? It would of been alot easier if they used a connection file but unfortunately they were all set manually and we have about 600 reports... Any help is much appreciated. Thanks Nick Yes you can... you make a program in c# or vb.net that loops throu all of your 600 documents and opens the documents and by using oModule = oBook.VBProject.VBComponents.Add(VBIDE.vbext_ComponentType.vbext_ct_StdModule) oModule.CodeModule.AddFromString

Close connection and statement finally

与世无争的帅哥 提交于 2019-12-05 04:33:14
Which is better for finally block: finally { try { con.close(); stat.close(); } catch (SQLException sqlee) { sqlee.printStackTrace(); } } Or: finally { try { if (con != null) { con.close(); } if (stat != null) { stat.close(); } } catch (SQLException sqlee) { sqlee.printStackTrace(); } } Better way to use is the 2nd one, because if an exception is thrown while initializing con or stat , they won't be initialized, and might be left initialized to null . In that case, using the 1st code will throw NullPointerException . Also, if you are already on Java 7 , you should consider using try-with

Standalone Tomcat 6.0.* + 20,000 simultaneous connections

爱⌒轻易说出口 提交于 2019-12-05 03:39:16
问题 Does anyone know how to configure Tomcat 6.0 as a standalone web server (on Windows XP) that can handle 20,000 simultaneous connections? Please help me. 回答1: If you configure it to use the HTTP NIO connector and give it enough memory, it must in theory be able to do so. With the normal HTTP connector, the performance will start to slowdown around 1K connections and then drastically drop around 5K simultaneous connections, simply because each connection implicitly uses its own thread. The HTTP

Unable to connect from remote machine

孤街浪徒 提交于 2019-12-05 03:04:05
I have some kind of problem and I can't check this at home if its working or not. Here is the code using System; using System.Net; using System.Net.Sockets; using System.Threading; using System.IO; using System.Net.Security; class Program { private static IPAddress ipAddress = IPAddress.Parse("127.0.0.1"); private static int port = 6000; private static string data = null; static void Main(string[] args) { Thread thread = new Thread(new ThreadStart(receiveThread)); thread.Start(); Console.ReadKey(); } public static void receiveThread() { while (true) { TcpListener tcpListener = new TcpListener

What to do to make the HSQL driver working?

前提是你 提交于 2019-12-05 02:55:36
问题 I'm currently learning some database tricks in Java and I found this nice book I'm reading. At some point, it encourages me to try a manual database connection with the following class: import java.sql.DriverManager; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; public class DemoSelect { public static void main(final String[] arguments) { // Connection parameters String usr = "sa"; String pwd = ""; String driver = "org.hsqldb.jdbcDriver"; String url

How can I receive data from URL on iPhone?

隐身守侯 提交于 2019-12-05 02:53:16
问题 I'm using the code from Apple's Document to do some HTTP communication. I can connect to the URL successfully, but I failed to receive the data from my server. // create the request NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://..."] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // create the connection with the request // and start loading the data NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest

Connect multiple databases dynamically in laravel

本小妞迷上赌 提交于 2019-12-05 02:50:57
问题 I'm building an application which requires connecting 2 database. first one is static and another one is dynamic. config/database.php is like 'mysql' => array ( 'driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'blog', 'username' => 'root', 'password' => '', 'unix_socket' => '', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => NULL, ), 'business2' => array ( 'driver' => 'mysql', 'host' => '127.0.0.1', 'port' =

how to determine, if an internet connection is currently available and active on an android device?

不羁岁月 提交于 2019-12-05 02:28:19
问题 i have this android application that requires to load data from a remote server via the internet. this update-functionaliy obviously requires the device to not only be connected to some kind of network, but also to the internet. so: is want to schedule the update-service to some date and when it starts, it should determine whether it actually CAN reach the target server or not. therefore, a simple "is the device connected to wifi?" does not suffice, as the device may be connected to a

Database (database/database.sqlite) does not exist. Database works from artisan tinker

99封情书 提交于 2019-12-05 01:07:36
I created my database.sqlite file in the database folder. My .env file contents are : DB_CONNECTION=sqlite DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=absolute\path\to\database\database.sqlite DB_USERNAME=admin DB_PASSWORD= When I run php artisan tinker and DB::table('users')->get(); I get the info from the database. My DatabaseController is: class DatabaseController extends Controller { public function main() { $users = DB::table('users')->get(); return view('database',compact($users)); } } Yet when I request /database path I get the error: QueryException in Connection.php line 647: Database

how does hibernate sessionfactory manage session?

。_饼干妹妹 提交于 2019-12-05 00:49:19
问题 I have just got the relationship between Hibernate Session and Connection. But now, I get another question: how does hibernate sessionfactory manage session? In the following code segment: save() method of a DAO class: Session session = sessionFactory.openSession(); Transaction tx=null; tx=session.beginTransaction(); session.save(transientInstance); session.flush(); tx.commit(); When we call sessionFactory.openSession() , it will create a new session attached to the current thread (through