
org.fastquery.dsm.JdbcConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastquery Show documentation
Show all versions of fastquery Show documentation
Method of fast database query in complicated environment.
/*
* Copyright (c) 2016-2088, fastquery.org and/or its affiliates. All rights reserved.
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information, please see http://www.fastquery.org/.
*
*/
package org.fastquery.dsm;
/**
* jdbc-config.xml 的实体
*
* @author xixifeng ([email protected])
*/
public class JdbcConfig {
private String driverClass;
private String databaseName;
private String password;
private int portNumber;
private String serverName;
private String user;
private String url;
private String named; // 重写hashCode和equals
public String getDatabaseName() {
return databaseName;
}
public void setDatabaseName(String databaseName) {
this.databaseName = databaseName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getPortNumber() {
return portNumber;
}
public void setPortNumber(int portNumber) {
this.portNumber = portNumber;
}
public String getServerName() {
return serverName;
}
public void setServerName(String serverName) {
this.serverName = serverName;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getNamed() {
return named;
}
/**
* 设置named
* 注意: 已经根据named重写了hashCode和equals,用于标识该对象在比较时作为唯一标识. 修改这个属性要特别注意.
* 如果把这个对象放入到hash集合中,而在外界修改了这个属性,那么会出现内存溢出
*
* @param named 数据源名称
*/
public void setNamed(String named) {
this.named = named;
}
public String getDriverClass() {
return driverClass;
}
public void setDriverClass(String driverClass) {
this.driverClass = driverClass;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((named == null) ? 0 : named.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
JdbcConfig other = (JdbcConfig) obj;
if (named == null) {
if (other.named != null)
return false;
} else if (!named.equals(other.named))
return false;
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy