|
problem with Serialize.store: msg#00199db.postgresql.jdbc
I've a problem with Serialize.store. I get this message: Exception in thread "main" java.sql.SQLException: ERROR: Attribute 'miaclasse' not found at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:103) at org.postgresql.Connection.ExecSQL(Connection.java:398) at org.postgresql.Connection.ExecSQL(Connection.java:381) at org.postgresql.util.Serialize.storeObject(Serialize.java:392) at org.postgresql.util.Serialize.store(Serialize.java:278) at Connessione.main(Connessione.java:18) for the attached piece of code (3 class). I don't get this message If I declare attribute "m" of class prova "private" or "protected". Someone can help me? THANK'S!!!! ************************************************ Connessione.java (main class) ************************************************ import java.io.*; import java.sql.*; import org.postgresql.util.*; import org.postgresql.core.QueryExecutor; public class Connessione { public static void main(String args[]) throws Exception { org.postgresql.Connection conn; prova m = new prova(); prova obj; Class.forName("org.postgresql.Driver"); conn = (org.postgresql.Connection)DriverManager.getConnection("jdbc:postgresql:provaASI", "daniele",""); // works org.postgresql.util.Serialize.create(conn, m); // makes problems org.postgresql.util.Serialize s = new Serialize(conn,m); int oid = s.store(m); obj = (prova)s.fetch(oid); System.out.println(obj.number); } } ************************************************ End Connessione.java ************************************************ ************************************************ prova.java ************************************************ import java.io.*; import java.sql.SQLException; public class prova implements Serializable { public int number; public miaclasse m; public prova() throws ClassNotFoundException, FileNotFoundException,IOException, SQLException { number=4; m = new miaclasse(); } } ************************************************ End prova.java ************************************************ ************************************************ miaclasse.java ************************************************ import java.io.*; import java.sql.SQLException; public class miaclasse implements Serializable { String s; public int i; public miaclasse() throws ClassNotFoundException, FileNotFoundException,IOException, SQLException { i=323; s="stringa"; } public String getS() {return s;} } ************************************************ End miaclasse.java ************************************************ ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx) |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Interrupt execution: 00199, Varun Kacholia |
|---|---|
| Next by Date: | Latest JDBC Documentation: 00199, Varun Kacholia |
| Previous by Thread: | Interrupt executioni: 00199, Varun Kacholia |
| Next by Thread: | servlets and JDBC (postgresql 7.2): 00199, Frederick Klauschen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |