@@ -0,0 +1,3082 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements.  See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership.  The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License.  You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied.  See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage com.treasuredata.jdbc;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.DriverManager;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.sql.Statement;%0Aimport java.util.Properties;%0A%0A/**%0A * td-jdbc usage example%0A */%0Apublic class Example%0A%7B%0A    public static void basicUsage()%0A            throws SQLException%0A    %7B%0A        Connection conn = DriverManager.getConnection(%0A                %22jdbc:td://api.treasuredata.com/sample_datasets%22,%0A                %22(your account email address)%22,%0A                %22(your account password)%22);%0A        Statement st = conn.createStatement();%0A        try %7B%0A            ResultSet rs = st.executeQuery(%22SELECT count(1) FROM www_access%22);%0A            while (rs.next()) %7B%0A                int count = rs.getInt(1);%0A                System.out.println(%22result = %22 + count);%0A            %7D%0A            rs.close();%0A        %7D%0A        finally %7B%0A            st.close();%0A            conn.close();%0A        %7D%0A    %7D%0A%0A    public static void propertyConfig()%0A            throws SQLException%0A    %7B%0A        Properties props = new Properties();%0A        props.setProperty(%22user%22, %22(your account e-mail)%22);%0A        props.setProperty(%22password%22, %22(your password)%22);%0A%0A        // Set the other options%0A%0A        // Use SSL (default) or not%0A        // props.setProperty(%22useSSL%22, %22true%22);%0A%0A        // Run Hive jobs. The default is %22presto%22%0A        // props.setProperty(%22type%22, %22hive%22);%0A%0A        // proxy configurarion (optional)%0A        // props.setProperty(%22httpproxyhost%22, %22(proxy host)%22);%0A        // props.setProperty(%22httpproxyport%22, %22(proxy port)%22);%0A        // props.setProperty(%22httpproxyuser%22, %22(proxy username)%22);%0A        // props.setProperty(%22httpproxypassword%22, %22(proxy password)%22);%0A%0A        Connection conn = DriverManager.getConnection(%0A                %22jdbc:td://api.treasuredata.com/sample_datasets%22,%0A                props%0A        );%0A        Statement st = conn.createStatement();%0A        try %7B%0A            ResultSet rs = st.executeQuery(%22SELECT count(1) FROM www_access%22);%0A            while (rs.next()) %7B%0A                int count = rs.getInt(1);%0A                System.out.println(%22result = %22 + count);%0A            %7D%0A            rs.close();%0A        %7D%0A        finally %7B%0A            st.close();%0A            conn.close();%0A        %7D%0A    %7D%0A

Add JDBC usage example