Hi,
I have to insert data into a database table using jsp and jdbc, query the table data and convert resultset into an xml file. I am using NetBeans IDE. I'm really stuck and i have a project due. Please do help.
Thanks in advance.
I have to convert resultset into xml file. Inserting into database table and querying the contents of the table is done. But unable to generate xml file. . Please help.
XML is just well formatted text data. Are you familiar with the java.io package and writing to files? And are you comfortable going through a ResultSet and accessing its contents?
Thanks for your reply.
I am using postgresql. I'm pretty comfortable with resultset. I'm using netbeans IDE. This can be easily done using PHP.But in netbeans i'm unable to use php in java projects. So stuck.
OK, well the JDBC tutorial will show you how to access things from your ResutlSet, and the basic io second of the Java tutorial will show you how to do the other other part.
I'v attached my code along with this. It's not working. This is the just a sample code i craetes to learn how it works. Inserting into database is perfectly working.
Converting to xml is not. Please do tel me what m doing wrong.
A couple of points: saying "its not working" makes it difficult to help. You need to tell us what is going wrong, especially if there is a stack trace. The other is code in a JSP is bad. I know this is just to learn, but it actually makes things harder to develop.
That aside, I don't see any code that saves or streams your Document?