java - Adding A An ArrayList, that is stored in a SQL database, to a table in jForm -


My problem is currently that I am unable to get my room list for my hotel management GUI, my jTable.

My current code for this is:

Roommaker:

  Public AERLIT < Cell & gt; GetRooms (Connection Con) {ArrayList & lt; Cell & gt; Room = new ArrayList (); String sqlString1 = "select from room" + "order by room_ID"; String sqlString2 = "SELECT TABLE_NAME" from USER_TABLES; Statement made statement; Try {statement = con.prepareStatement (sqlString1); Results reset rs = statement.executeQuery (); Int i = 0; While (rsnext ()) {i ++; Println (rs.getString (1)); System.out.println ("Just Add Room NB" + i); Rooms.add (new room (rs.getInt (1), rs.getInt (2), 0, "string string"); } Statement.close (); } Hold (exception e) {System.out.println ("Access failed - RoomRooms"); Println (e.getMessage ()); } System.out.println ("Room Surfing Size:" + rooms.size ()); Return room; }  

cell class:

  public class room {Private id ID; Private Intimate Room ID; Private Int RoomBookingId; The name of the private string; Public room (int id, int id format id, int roombuying id, string name) {this.Id = Id; This.RoomTypeId = RoomTypeId; This.RoomBookingId = RoomBookingId; This.Name = name; } Public int getId () {return ID; } Public int getRoomTypeId () {return RoomTypeId; } Public int getRoomBookingId () {Return RoomBookingId; } Public string getName () {return name; } Public Zero Set Id (Ent ID) {this.Id = Id; } Public Zero setRoomTypeId (Int RoomTypeId) {this.RoomTypeId = RoomTypeId; } Public Zero SatuBooking ID (Intel Roombooking ID) {this.RoomBookingId = RoomBookingId; } Public Zero Setname (string name) {this.Name = name; }}  

and my jTable implantation:

  Public HotelGuiForm () throws ClassNotFoundException, SQLException {initComponents (); Default tabloadmodel dtm = new default table modal (); ArrayList & LT; Cell & gt; Rooms = New Arrestists & lt; & Gt; (); Class.forName ("oracle.jdbc.driver.OracleDriver"); String string cone = "jdbc: oracle: thin: @ datdb.cphbusiness.dk: 1521: data; user; cphsh241; password; cphsh241"; Connection con = DriverManager.getConnection (stringCon); Java.sql.Statement state = con.createStatement (); Results reset rs = state.executeQuery ("select from Room_Booking"); As a result metadata rsmetadata = rs.getMetaData (); Int column = rsmetadata.getColumnCount (); Vector column_name; Columns_name = new vector (); Vector data_roo; Data_rows = new vector (); For (int i = 1; i  

Every time I run a project, I get a bunch of JDBC errors, which I can list here:

  at oracle.jdbc .driver.T4CConnection at Oracle.jdbc.driver.T4CConnection & lt; Init & gt; (T4CConnection.java:385) at oracle.jdbc.driver.fysicalConnection. And lt; Init & gt; (Physical Connection. Java: 715) .logon (T4CConnection.java:673) Oracle.jdbc.driver.T4CDriverExtension.getConnection (T4CDriverExtension.java.30) Java on java.sql.DriverManager.getConnection (DriverManager.javaEND_BOLD71) on oracle .jdbc.driver.OracleDriver.connect (OracleDriver.java) at 64) .sql.DriverManager.getConnection (DriverManager.java3333) on the presentation. HotelGuieform. & Lt; Init & gt; (HotelGuiForm.java46) in the presentation. Reason: by orange.net.ns.NetException: The listener declined the connection with the following error: ORA-12505, TNS: the listener is currently oracle.net.ns.NSProtocolStream. Do not know about the SID given in the connect descriptor on the connectate, oracle.jdbc.driver.T4CConnection at oracle.jdbc.driver.T4CConnection.connect (T4CConnection.java1360) oracle.net.ns.NSProtocol.connect (NSProtocol. Java.63) nection (NSProtocolStream.java .7272) .logon (T4CConnection.java:48686) ... 8 more  

Does anyone see the underlying problem, because I see it He fails in area, and it's really bugging me, as I am now working for a few days.

I really appreciate it if someone can help me with it.

Thank you.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -