Java connection pool usage method 2

xiaoxiao2021-03-06  64

How to use: Connect SQLServer: Class.Forname ("Net.SourceForge.jtds.jdbc.driver"). NewInstance (); string url = "JDBC: JTDS: SQLSERVER: // Localhost: 1433 / Check"; // Check is Database name CNN = DriverManager.getConnection (URL, USER, PASSWORD);

Its help is written like this: driver: net.sourceforge.jtds.jdbc.driverURL: The URL Format for JTDS IS: JDBC: JTDS: : // [: ] [/ ] [; = [; ...] Where is one of either 'sqlser' or 'sybase' (their meaning is quite obvious), is the port the database Server is listening to (default is 1433 for SQL Server and 7100 for Sybase) and is the database name - JDBC term:. catalog - (if not specified, the user's default database is used) The set of properties supported by JTDS IS:

user (required) User name to use for login. When using getConnection (String url, String user, String password) it's not required to set this property as it is passed as parameter, but you will have to set it when using getConnection (String url, Properties info) or TdsDataSource. password (required) password to use for login. When using getConnection (String url, String user, String password) it's not required to set this property as it is passed as parameter, but you will have to Set it when Using getConnection (String Url, Properties Info) or tdsdataserce. This is used for Sybase or SQLServer, other databases you have to look at it ----------------- -------------------------------------------------- ------------------ Article address: http://community.9cbs.net/expert/topic/3589/3589555.xml? Temp = .952572

转载请注明原文地址:https://www.9cbs.com/read-85628.html

New Post(0)