Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/manager/target/
/driver/target/
/server/target/
13 changes: 10 additions & 3 deletions driver/src/main/java/com/alibaba/cobar/jdbc/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@
import java.util.Properties;

import com.mysql.jdbc.NonRegisteringDriver;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;

/**
* 在使用集群时提供负载均衡的功能,其他情况和MySQLDriver一样。
*
*
* <pre>
* 使用方法:
* Class.forName("com.alibaba.cobar.jdbc.Driver");
* String url = "jdbc:cobar://host:port/dbname?user=xxx&password=xxx";
* ...
* </pre>
*
*
* @author xianmao.hexm 2012-4-27
*/
public class Driver extends NonRegisteringDriver implements java.sql.Driver {
Expand All @@ -51,7 +53,7 @@ public class Driver extends NonRegisteringDriver implements java.sql.Driver {

/**
* Construct a new driver and register it with DriverManager
*
*
* @throws SQLException if a database error occurs.
*/
public Driver() throws SQLException {
Expand All @@ -73,4 +75,9 @@ public DriverPropertyInfo[] getPropertyInfo(String url, Properties info) throws
return super.getPropertyInfo(UrlProvider.getMySQLUrl(url), info);
}

@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException("Not supported yet.");
}

}
1 change: 1 addition & 0 deletions manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.2.3</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>xpp3</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;

import javax.sql.DataSource;

Expand Down Expand Up @@ -72,4 +74,9 @@ public Connection getConnection(String username, String password) throws SQLExce
return null;
}

@Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException("Not supported yet.");
}

}