Order Tray | Contact Us | Home | SIG Lists

[aprssig] Oracle connection ?

Gregg Wonderly gregg at wonderly.org
Thu Jun 23 14:43:29 UTC 2005


>I have the opportunity to place aprs data on an oracle database.
>
>anyone had experience developing access mechanisms to connect 
>to oracle ?

>3) Java

Andy, the JDBC interface in Java is straight forward to use.  If you need some help, I can give you some code, and make 
some suggestions.  The place to start is

Connection c = java.sql.DriverManager.getConnection( ... connection parms ... );
Statement stmt = c.getStatement();
try {
	int val = stmt.executeUpdate( "insert into <table> (...) values (...)");
} finally {
	stmt.close();
}

and for queries,

try {
	ResultSet rs = stmt.executeQuery( "select f1,f2,f3 from <table> where ...");
	try {
		while( rs.next() ) {
			String f1 = rs.getString("f1");
			double f2 = rs.getDouble("f2");
			... do something with the queried data ...
		}
	} finally {
		rs.close();
	}
} finally {
	stmt.close();
}

Gregg Wonderly




More information about the aprssig mailing list