Note that there are some explanatory texts on larger screens.

plurals
  1. POno postgresql user name specified in startup packet
    primarykey
    data
    text
    <pre><code>public class HelloPostgreSQLActivity extends Activity { TextView resultArea; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resultArea = new TextView(this); resultArea.setText("Please wait."); setContentView(resultArea); new FetchSQL().execute(); } private class FetchSQL extends AsyncTask &lt;Void,Void,String&gt; { @Override protected String doInBackground(Void... params) { //TextView tv=(TextView)findViewById(R.id.text); String retval = ""; // String msg="connected"; try { Class.forName("org.postgresql.Driver"); // tv.setText(msg); } catch (ClassNotFoundException e) { e.printStackTrace(); retval = e.toString(); } String url = "jdbc:postgresql://192.168.1.92/postgres? user = postgres &amp; password = admin"; Connection conn; try { DriverManager.setLoginTimeout(25); conn = DriverManager.getConnection(url); Statement st = conn.createStatement(); String sql; sql = "SELECT 1"; ResultSet rs = st.executeQuery(sql); while(rs.next()) { retval = rs.getString(1); } rs.close(); st.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); retval = e.toString(); } return retval; } @Override protected void onPostExecute(String value) { resultArea.setText(value); } } } </code></pre> <p><br> I run my program in Android Emulator. My program has the following error.</p> <pre><code>org.postgresql.util.PSQLException : FATAL: no PostgreSQL Username specified in startup packet. </code></pre> <p>What's wrong in my program what should i do?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload