<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Forum PostgreSQL - Problem z odczytaniem tabeli w javie]]></title>
		<link>https://forum.postgresql.org.pl/viewtopic.php?id=549</link>
		<description><![CDATA[Najświeższe odpowiedzi w Problem z odczytaniem tabeli w javie.]]></description>
		<lastBuildDate>Wed, 23 Oct 2013 08:07:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Odp: Problem z odczytaniem tabeli w javie]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4772#p4772</link>
			<description><![CDATA[do [b]sandrela[/b]
Przenieś swoje zapytanie do nowego tematu (trzeba utrzymywać jakiś porządek na forum), a postaram Ci udzielić odpowiedzi]]></description>
			<author><![CDATA[dummy@example.com (c_michal)]]></author>
			<pubDate>Wed, 23 Oct 2013 08:07:14 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4772#p4772</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Problem z odczytaniem tabeli w javie]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4771#p4771</link>
			<description><![CDATA[Cześć. Chce zrobić coś takiego, że łącze się z serwerem bazy i bez wyboru bazy danych. I wtedy jak się połącze selectuje wszystkie bazy do których mam prawa przynajmniej do odczytu.]]></description>
			<author><![CDATA[dummy@example.com (sandrela)]]></author>
			<pubDate>Tue, 22 Oct 2013 12:28:05 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4771#p4771</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Problem z odczytaniem tabeli w javie]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=2405#p2405</link>
			<description><![CDATA[Zgadza się H to nie to samo co "H". Zmieniłem składnię zapytania na 

String mojsql = "Select * from \"T1\""; 
rs = stmt.executeQuery(mojsql);

.... i wszystko działa. 

Dziękuję za pomoc Temat uważam za zamknięty. 

Pozdrawiam]]></description>
			<author><![CDATA[dummy@example.com (grzesinfo)]]></author>
			<pubDate>Sat, 19 Feb 2011 15:56:45 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=2405#p2405</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Problem z odczytaniem tabeli w javie]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=2404#p2404</link>
			<description><![CDATA[No to pytanie czy istnieje h czy H.
Czy czasem jak tworzyłeś table to czasem nie napisałeś nazwy tabeli w cudzysłowie znaczy
[code]
create table "H"....
[/code]
bo jeśli tak to aby odczytać zawartość takiej tabeli musisz napisać
[code]
select * from "H"
[/code]
a to nie to samo co 
[code]
select * from H
[/code]]]></description>
			<author><![CDATA[dummy@example.com (rski)]]></author>
			<pubDate>Sat, 19 Feb 2011 15:33:51 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=2404#p2404</guid>
		</item>
		<item>
			<title><![CDATA[Problem z odczytaniem tabeli w javie]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=2402#p2402</link>
			<description><![CDATA[Witam 

   Mam problem z wykonaniem selecta na tabeli w Postgresie. Podłączenie do bazy przebiega poprawnie. Odczytuje bieżący czas z serwera bazy, a w momencie wykonania Selecta do tabeli wali błędem. Zaznaczam że tabela H istnieje w schemacie public. 

Proszę o pomoc. 



Kod programu: 

	private static void baza()
	{
		String url = "jdbc:postgresql://localhost/my";
		Properties props = new Properties();
		props.setProperty("user","postgres");
		props.setProperty("password","postgre");
		//props.setProperty("ssl","true");
		try {
			Connection conn = DriverManager.getConnection(url, props);
			System.out.println("Połączenie do Postgres OK.");
			Statement stmt = conn.createStatement();			
			ResultSet rs;
			PreparedStatement ps ;
			//ps = conn.prepareStatement("Select * from T1");
			rs = stmt.executeQuery("Select Now()");
			rs.next();
			System.out.println("Time:   "+rs.getString(1));
			stmt.executeQuery("Select * from  H");
			while (rs.next())
			{
				String sss = "A"+""+rs.getString(1);
				System.out.println(sss);
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


Błąd: 

Połączenie do Postgres OK.
Time:   2011-02-18 20:42:54.437+01
org.postgresql.util.PSQLException: ERROR: relation "h" does not exist
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:374)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
	at Fglowna.baza(Fglowna.java:50)
	at Fglowna.main(Fglowna.java:70)]]></description>
			<author><![CDATA[dummy@example.com (grzesinfo)]]></author>
			<pubDate>Fri, 18 Feb 2011 19:45:57 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=2402#p2402</guid>
		</item>
	</channel>
</rss>
