org.postgresql.Driver.parseURL()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.postgresql.Driver.parseURL()方法的一些代码示例,展示了Driver.parseURL()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Driver.parseURL()方法的具体详情如下:
包路径:org.postgresql.Driver
类名称:Driver
方法名:parseURL

Driver.parseURL介绍

[英]Constructs a new DriverURL, splitting the specified URL into its component parts
[中]构造一个新的DriverURL,将指定的URL拆分为其组件

代码示例

代码示例来源:origin: org.postgresql/postgresql

/**
 * Returns true if the driver thinks it can open a connection to the given URL. Typically, drivers
 * will return true if they understand the subprotocol specified in the URL and false if they
 * don't. Our protocols start with jdbc:postgresql:
 *
 * @param url the URL of the driver
 * @return true if this driver accepts the given URL
 * @see java.sql.Driver#acceptsURL
 */
@Override
public boolean acceptsURL(String url) {
 return parseURL(url, null) != null;
}

代码示例来源:origin: postgresql/postgresql

/**
 * Returns true if the driver thinks it can open a connection to the
 * given URL.  Typically, drivers will return true if they understand
 * the subprotocol specified in the URL and false if they don't.  Our
 * protocols start with jdbc:postgresql:
 *
 * @see java.sql.Driver#acceptsURL
 * @param url the URL of the driver
 * @return true if this driver accepts the given URL
 * @exception SQLException if a database-access error occurs
 * (Dont know why it would *shrug*)
 */
public boolean acceptsURL(String url) throws SQLException
{
  if (parseURL(url, null) == null)
    return false;
  return true;
}

代码示例来源:origin: postgresql/postgresql

parseURL(url, copy);

代码示例来源:origin: org.postgresql/postgresql

/**
 * <p>The getPropertyInfo method is intended to allow a generic GUI tool to discover what properties
 * it should prompt a human for in order to get enough information to connect to a database.</p>
 *
 * <p>Note that depending on the values the human has supplied so far, additional values may become
 * necessary, so it may be necessary to iterate through several calls to getPropertyInfo</p>
 *
 * @param url the Url of the database to connect to
 * @param info a proposed list of tag/value pairs that will be sent on connect open.
 * @return An array of DriverPropertyInfo objects describing possible properties. This array may
 *         be an empty array if no properties are required
 * @see java.sql.Driver#getPropertyInfo
 */
@Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) {
 Properties copy = new Properties(info);
 Properties parse = parseURL(url, copy);
 if (parse != null) {
  copy = parse;
 }
 PGProperty[] knownProperties = PGProperty.values();
 DriverPropertyInfo[] props = new DriverPropertyInfo[knownProperties.length];
 for (int i = 0; i < props.length; ++i) {
  props[i] = knownProperties[i].toDriverPropertyInfo(copy);
 }
 return props;
}

代码示例来源:origin: org.postgresql/postgresql

/**
 * Sets properties from a {@link DriverManager} URL.
 *
 * @param url properties to set
 */
public void setUrl(String url) {
 Properties p = org.postgresql.Driver.parseURL(url, null);
 for (PGProperty property : PGProperty.values()) {
  setProperty(property, property.get(p));
 }
}

代码示例来源:origin: org.postgresql/postgresql

if ((props = parseURL(url, props)) == null) {
 return null;

代码示例来源:origin: postgresql/postgresql

if ((props = parseURL(url, props)) == null)

代码示例来源:origin: org.ancoron.postgresql/org.postgresql

/**
 * Returns true if the driver thinks it can open a connection to the
 * given URL.  Typically, drivers will return true if they understand
 * the subprotocol specified in the URL and false if they don't.  Our
 * protocols start with jdbc:postgresql:
 *
 * @see java.sql.Driver#acceptsURL
 * @param url the URL of the driver
 * @return true if this driver accepts the given URL
 * @exception SQLException if a database-access error occurs
 * (Dont know why it would *shrug*)
 */
public boolean acceptsURL(String url) throws SQLException
{
  if (parseURL(url, null) == null)
    return false;
  return true;
}

代码示例来源:origin: org.ancoron.postgresql/org.postgresql.osgi

/**
 * Returns true if the driver thinks it can open a connection to the
 * given URL.  Typically, drivers will return true if they understand
 * the subprotocol specified in the URL and false if they don't.  Our
 * protocols start with jdbc:postgresql:
 *
 * @see java.sql.Driver#acceptsURL
 * @param url the URL of the driver
 * @return true if this driver accepts the given URL
 * @exception SQLException if a database-access error occurs
 * (Dont know why it would *shrug*)
 */
public boolean acceptsURL(String url) throws SQLException
{
  if (parseURL(url, null) == null)
    return false;
  return true;
}

代码示例来源:origin: org.ancoron.postgresql/org.postgresql.osgi

parseURL(url, copy);

代码示例来源:origin: org.ancoron.postgresql/org.postgresql

parseURL(url, copy);

代码示例来源:origin: org.ancoron.postgresql/org.postgresql

if ((props = parseURL(url, props)) == null)

代码示例来源:origin: org.ancoron.postgresql/org.postgresql.osgi

if ((props = parseURL(url, props)) == null)

相关文章