How to recover part of compound data with JDBC?

0

I have a small application that connects with postgresql , it stores 2 objects,

  • Equipment that has three values: store type String , range type String and finally price type int .

To store them, I occupy a type composed of the three values that I have called datosPC .

  • Componentes that I save it with a array of 3 data type string in the database.

My question: When doing the resultSet, how can I retrieve one of the Team values? And to recover a value of Components?

Thanks for your time!

    
asked by Jota 28.10.2016 в 13:29
source

1 answer

0
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT * FROM mytable WHERE columnfoo = 
500");
while (rs.next())
{
System.out.print("Column 1 returned ");
System.out.println(rs.getString(1));
}
rs.close();
st.close();
    
answered by 10.04.2017 в 20:47