summaryrefslogtreecommitdiff
path: root/src/dbc/scala/dbc/Vendor.scala
blob: 2099430646d7dae5162cd091b3e15bd2083692ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */



package scala.dbc;


import java.sql.{Connection, Driver};


/** This class ..
 */
@deprecated(DbcIsDeprecated) abstract class Vendor {

  def nativeDriverClass: Class[_];
  def uri: java.net.URI;
  def user: String;
  def pass: String;
  def nativeProperties: java.util.Properties = {
    val properties = new java.util.Properties();
    properties.setProperty("user", user);
    properties.setProperty("password", pass);
    properties
  }

  def retainedConnections: Int;

  def getConnection: Connection = {
    val driver = nativeDriverClass.newInstance().asInstanceOf[Driver];
    driver.connect(uri.toString(),nativeProperties)
  }

  def urlProtocolString: String;

}