Skip to content

sohudo/SequoiaDB-JDBC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

SequoiaDB-JDBC

SequoiaDB java jdbc 驱动

================ public static void main( String args[] ) throws SQLException , ClassNotFoundException { jdbcdriver="org.opencloudb.jdbc.sequoiadb.SequoiaDriver"; jdbcurl="sequoiadb://1426587161.dbaas.sequoialab.net:11920/SAMPLE"; String username="jifeng"; String password="jifeng"; Class.forName(jdbcdriver); Connection c = DriverManager.getConnection(jdbcurl,username,password); Statement st = c.createStatement();

	    print( "test jdbc " , st.executeQuery("select * from people ")); 

	}
	
		 static void print( String name , ResultSet res )
			        throws SQLException {
			        System.out.println( name);
			        ResultSetMetaData meta=res.getMetaData();				        
	                //System.out.println( "\t"+res.getRow()+"条记录");
	                String	str="";
	                for(int i=1;i<=meta.getColumnCount();i++){
	                	str+=meta.getColumnName(i)+"   ";
	                	//System.out.println( meta.getColumnName(i)+"   ");
	                }
	                System.out.println("\t"+str);
	                str="";
			        while ( res.next() ){
			        	for(int i=1;i<=meta.getColumnCount();i++){	
			        		str+= res.getString(i)+"   ";		
			        		} 
			        	System.out.println("\t"+str);
			        	str="";
			        }
			    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages