rfkill unblock all
Sistemi yeniden başlattığınızda wlan aktif olacaktır.
Would you like to have an instance of tea class?
<?xml version="1.0" encoding="UTF-8"?> <Configure class="org.mortbay.jetty.webapp.WebAppContext"> <New id="myds" class="org.mortbay.jetty.plus.naming.Resource"> <Arg>java:comp/env/jdbc/database</Arg> <Arg> <New class="org.postgresql.ds.PGSimpleDataSource"> <Set name="User">your_user_name
</Set> <Set name="Password">your_password </Set> <Set name="DatabaseName">your_database </Set> <Set name="ServerName">localhost</Set> <Set name="PortNumber">5432</Set> </New> </Arg> </New> </Configure>
- Server Properties: Uygulamanızın kaynak kodlarının bulunduğu dizinde ($projectName/src) server.properties dosyasını açın (yoksa oluşturun) ve aşağıdaki satırları ekleyin;
webRoot: __AUTODETECT__ gwtModuleName: <module_name> isomorphicPathRootRelative: $gwtModuleName/sc sql.defaultDatabase: PostgreSQL sql.PostgreSQL.autoJoinTransactions: true sql.PostgreSQL.interface.credentialsInURL: true sql.PostgreSQL.pool.enabled: false sql.PostgreSQL.driver.context: _container_ sql.PostgreSQL.driver: org.postgresql.Driver sql.PostgreSQL.driver.driverName: PostgreSQL sql.PostgreSQL.driver.networkProtocol: tcp sql.PostgreSQL.driver.url: sql.PostgreSQL.interface.type: jndi sql.PostgreSQL.database.type: postgresql sql.PostgreSQL.driver.name: jdbc/database sql.PostgreSQL.driver.driverType: thin
package com.blogspot.karslioglu;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MyClass {
public Connection retrieveConnection() throws Exception {
Connection connection = null;
Context context = new InitialContext();
DataSource dataSource = (DataSource) context.lookup("java:comp/env/jdbc/database");
connection = dataSource.getConnection();
return connection;
}
}