root / trunk / libraries / libJCRS / src / org / gvsig / crs / Query.java @ 8676
History | View | Annotate | Download (614 Bytes)
1 |
|
---|---|
2 |
package org.gvsig.crs; |
3 |
|
4 |
import java.io.Serializable; |
5 |
import java.sql.Connection; |
6 |
import java.sql.ResultSet; |
7 |
import java.sql.ResultSetMetaData; |
8 |
import java.sql.SQLException; |
9 |
import java.sql.Statement; |
10 |
|
11 |
public class Query implements Serializable{ |
12 |
|
13 |
/**
|
14 |
*
|
15 |
*/
|
16 |
private static final long serialVersionUID = 1L; |
17 |
|
18 |
public static synchronized ResultSet select(String sentence, Connection conn){ |
19 |
Statement st = null; |
20 |
ResultSet rs = null; |
21 |
|
22 |
try {
|
23 |
st = conn.createStatement(); |
24 |
rs = st.executeQuery(sentence); |
25 |
st.close(); |
26 |
} catch (SQLException e) { |
27 |
e.printStackTrace(); |
28 |
} |
29 |
return rs;
|
30 |
} |
31 |
} |
32 |
|