How to read a sound file in 1,java:
String wavename = "Voice.wav"; try {inputstream ws = GamePanel.class.getResourceAsStream (wavename); Audiostream as = new Audiostream (WS); AudioPlayer.player.start (AS); catch (Exception e) {System.out.println (E.getmessage ());}
2, configure the GlassFish jndi data source in spring:
The configuration process is simple, first login GlassFish background, resource-jdbc-connection pool, new JDBC connection pool, name casually fill (for example, FLY_JDBC), resource type Select the first DataSource, and then fill in the other property pages in the database username, password, And the access URL of the database. Click to complete, then click Ping Test, if the ping is not successful, a large reason is not a JDBC driver, so to the corresponding database driver file jar under the Domains/domain1/bin/ext file, Domain1 is the current project run the domain.
Then click the Resource-jdbc-jdbc resource, create a new JDBC resource, and the Jndi name can be filled in: for example, Fly_jnditest. Pool name Select Fly_jdbc, then OK.
The final step is to configure Spring DataSource.
<bean id= "DataSource" class= "Org.springframework.jndi.JndiObjectFactoryBean" >
<property name= "Jndin" Ame "value=" Fly_jnditest "></property>
</bean><!--value fills in the name of the JDBC resource-->