MCPcopy Create free account
hub / github.com/MariaDB/server / JdbcConnect

Method JdbcConnect

storage/connect/MariadbInterface.java:22–67  ·  view source on GitHub ↗
(String[] parms, int fsize, boolean scrollable)

Source from the content-addressed store, hash-verified

20 } // end of default constructor
21
22 @Override
23 public int JdbcConnect(String[] parms, int fsize, boolean scrollable) {
24 int rc = 0;
25 String url = parms[1];
26 DataSource ds = null;
27 MariaDbDataSource ads = null;
28
29 if (DEBUG)
30 System.out.println("Connecting to MariaDB data source");
31
32 try {
33 CheckURL(url, "mariadb");
34
35 if ((ds = dst.get(url)) == null) {
36 ads = new MariaDbDataSource();
37 ads.setUrl(url);
38
39 if (parms[2] != null)
40 ads.setUser(parms[2]);
41
42 if (parms[3] != null)
43 ads.setPassword(parms[3]);
44
45 ds = ads;
46
47 dst.put(url, ds);
48 } // endif ds
49
50 // Get a connection from the data source
51 conn = ds.getConnection();
52
53 // Get the data base meta data object
54 dbmd = conn.getMetaData();
55
56 // Get a statement from the connection
57 stmt = GetStmt(fsize, scrollable);
58 } catch (SQLException se) {
59 SetErrmsg(se);
60 rc = -2;
61 } catch( Exception e ) {
62 SetErrmsg(e);
63 rc = -3;
64 } // end try/catch
65
66 return rc;
67 } // end of JdbcConnect
68
69}

Callers

nothing calls this directly

Calls 5

CheckURLMethod · 0.80
GetStmtMethod · 0.80
getMethod · 0.45
putMethod · 0.45
SetErrmsgMethod · 0.45

Tested by

no test coverage detected